[IMP] better views project mgt
bzr revid: fp@tinyerp.com-20100121082147-8rpf0qh611z78f94
This commit is contained in:
@@ -493,7 +493,9 @@ class task(osv.osv):
|
||||
typeid = typ.type.id
|
||||
types = map(lambda x:x.id, typ.project_id.type_ids)
|
||||
if types:
|
||||
if typeid and typeid in types and types.index(typeid) != len(types)-1 :
|
||||
if not typeid:
|
||||
self.write(cr, uid, typ.id, {'type': types[0]})
|
||||
elif typeid and typeid in types and types.index(typeid) != len(types)-1 :
|
||||
index = types.index(typeid)
|
||||
self.write(cr, uid, typ.id, {'type': types[index+1]})
|
||||
return True
|
||||
|
||||
@@ -471,10 +471,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Task Edition">
|
||||
<group col="20" colspan="4">
|
||||
<filter string="By Users" icon="terp-project" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="By Project" icon="terp-project" domain="[]" context="{'group_by':'project_id'}"/>
|
||||
<filter string="By Type" icon="terp-project" domain="[]" context="{'group_by':'type'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Draft" domain="[('state','=','draft')]" help="Draft Tasks" icon="terp-project"/>
|
||||
<filter string="In Progress" domain="[('state','=','open')]" help="Open Tasks" icon="terp-project"/>
|
||||
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Tasks" icon="terp-project"/>
|
||||
@@ -488,6 +484,11 @@
|
||||
<filter domain="[('user_id','=',False)]" help="Unassigned Tasks" icon="gtk-execute" separator="1"/>
|
||||
</field>
|
||||
</group>
|
||||
<group expand="1" string="Group By..." colspan="4" col="20">
|
||||
<filter string="By Users" icon="terp-project" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="By Project" icon="terp-project" domain="[]" context="{'group_by':'project_id'}"/>
|
||||
<filter string="By Type" icon="terp-project" domain="[]" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -29,6 +29,7 @@ import tools
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
import ir
|
||||
from tools.translate import _
|
||||
|
||||
class project_gtd_context(osv.osv):
|
||||
_name = "project.gtd.context"
|
||||
@@ -148,9 +149,12 @@ class project_task(osv.osv):
|
||||
timebox_ids = timebox_obj.search(cr,uid,[])
|
||||
for task in self.browse(cr,uid,ids):
|
||||
timebox = task.timebox_id.id
|
||||
if timebox and timebox_ids.index(timebox) != 0 :
|
||||
index = timebox_ids.index(timebox)
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index - 1]})
|
||||
if timebox:
|
||||
if timebox_ids.index(timebox):
|
||||
index = timebox_ids.index(timebox)
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index - 1]})
|
||||
else:
|
||||
self.write(cr, uid, task.id, {'timebox_id': False})
|
||||
return True
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
@@ -159,7 +163,7 @@ class project_task(osv.osv):
|
||||
timebox_obj = self.pool.get('project.gtd.timebox')
|
||||
if res['type'] == 'search':
|
||||
tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[]))
|
||||
search_extended ='''<newline/><group col="%d">''' % (len(tt)+6,)
|
||||
search_extended ='''<newline/><group col="%d" expand="1" string="%s">''' % (len(tt)+6,_('Getting Things Done'))
|
||||
search_extended += '''<filter domain="[('timebox_id','=', False)]" icon="gtk-new" string="Inbox"/>'''
|
||||
search_extended += '''<separator orientation="vertical"/>'''
|
||||
for time in tt:
|
||||
|
||||
Reference in New Issue
Block a user