[imp] Project Views
bzr revid: fp@tinyerp.com-20100118213814-pubyra7tvsjjyvd5
This commit is contained in:
@@ -277,7 +277,7 @@ class task(osv.osv):
|
||||
|
||||
_columns = {
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the task without removing it."),
|
||||
'name': fields.char('Task summary', size=128, required=True),
|
||||
'name': fields.char('Task Summary', size=128, required=True),
|
||||
'description': fields.text('Description'),
|
||||
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'),
|
||||
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of tasks."),
|
||||
@@ -525,4 +525,4 @@ class users(osv.osv):
|
||||
|
||||
users()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -476,7 +476,7 @@
|
||||
<search string="Task Edition">
|
||||
<group col="8" colspan="4">
|
||||
<filter string="Draft" domain="[('state','=','draft')]" help="Draft Tasks" icon="terp-project"/>
|
||||
<filter string="Open" domain="[('state','=','open')]" help="Open 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"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select="1"/>
|
||||
@@ -486,7 +486,7 @@
|
||||
</group>
|
||||
<group col="4" colspan="1">
|
||||
<field name="user_id" select="1" widget="selection">
|
||||
<filter domain="[('user_id','=',uid)]" help="My Tasks" icon="gtk-execute"/>
|
||||
<filter domain="[('user_id','=',uid)]" help="My Tasks" icon="gtk-execute" default="1"/>
|
||||
<filter domain="[('user_id','=',False)]" help="Unassigned Tasks" icon="gtk-execute" separator="1"/>
|
||||
</field>
|
||||
</group>
|
||||
@@ -495,7 +495,7 @@
|
||||
</record>
|
||||
|
||||
<record id="action_view_task" model="ir.actions.act_window">
|
||||
<field name="name">All Tasks</field>
|
||||
<field name="name">Tasks</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,calendar,gantt,graph</field>
|
||||
@@ -650,7 +650,7 @@ menu_main
|
||||
<act_window
|
||||
domain="[('project_id', '=', active_id)]"
|
||||
id="act_project_project_2_project_task_all"
|
||||
name="All Tasks"
|
||||
name="Tasks"
|
||||
res_model="project.task"
|
||||
src_model="project.project"
|
||||
view_mode="tree,form,calendar,graph"
|
||||
|
||||
@@ -130,17 +130,17 @@ class project_task(osv.osv):
|
||||
_defaults = {
|
||||
'context_id': _get_context
|
||||
}
|
||||
|
||||
def next_timebox(self, cr, uid, ids, *args):
|
||||
timebox_obj = self.pool.get('project.gtd.timebox')
|
||||
timebox_ids = timebox_obj.search(cr,uid,[])
|
||||
if not timebox_ids: return True
|
||||
for task in self.browse(cr,uid,ids):
|
||||
timebox = task.timebox_id.id
|
||||
if timebox and timebox_ids.index(timebox) != len(timebox_ids)-1 :
|
||||
if not timebox:
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[0]})
|
||||
elif timebox_ids.index(timebox) != len(timebox_ids)-1:
|
||||
index = timebox_ids.index(timebox)
|
||||
else:
|
||||
index = -1
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index+1]})
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index+1]})
|
||||
return True
|
||||
|
||||
def prev_timebox(self, cr, uid, ids, *args):
|
||||
@@ -150,11 +150,9 @@ class project_task(osv.osv):
|
||||
timebox = task.timebox_id.id
|
||||
if timebox and timebox_ids.index(timebox) != 0 :
|
||||
index = timebox_ids.index(timebox)
|
||||
else:
|
||||
index = len(timebox_ids)
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index - 1]})
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index - 1]})
|
||||
return True
|
||||
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = super(project_task,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
|
||||
search_extended = False
|
||||
@@ -162,14 +160,14 @@ class project_task(osv.osv):
|
||||
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 += '''<filter domain="[('timebox_id','=', 0)]" icon="gtk-new" string="Inbox"/>'''
|
||||
search_extended += '''<filter domain="[('timebox_id','=', False)]" icon="gtk-new" string="Inbox"/>'''
|
||||
search_extended += '''<separator orientation="vertical"/>'''
|
||||
for time in tt:
|
||||
if time.icon:
|
||||
icon = time.icon
|
||||
else :
|
||||
icon=""
|
||||
search_extended += ''' <filter domain="[('timebox_id','=', ''' + str(time.id) + ''')]" icon="''' + icon + '''" string="''' + time.name + '''"/>'''
|
||||
search_extended += '''<filter domain="[('timebox_id','=', ''' + str(time.id) + ''')]" icon="''' + icon + '''" string="''' + time.name + '''"/>'''
|
||||
search_extended += '''
|
||||
<separator orientation="vertical"/>
|
||||
<field name="context_id" select="1" widget="selection"/>
|
||||
|
||||
@@ -76,8 +76,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="project_id" position="after">
|
||||
<field name="timebox_id"/>
|
||||
<button name="next_timebox" string="Next Timebox" type="object" icon="gtk-indent" attrs="{'invisible':[('timebox_id.type','=','other')]}"/>
|
||||
<button name="prev_timebox" string="Previous Timebox" type="object" icon="gtk-indent" attrs="{'invisible':[('timebox_id.type','=','daily')]}"/>
|
||||
<button name="prev_timebox" string="Previous Timebox" type="object" icon="gtk-indent" states="draft,open,pending"/>
|
||||
<button name="next_timebox" string="Next Timebox" type="object" icon="gtk-indent" states="draft,open,pending"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@@ -103,12 +103,16 @@
|
||||
<field eval="2" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="top" colors="grey:state in ('done',);red:state in ('cancelled');black:state not in ('done','cancelled')" string="Tasks">
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="timebox_id" widget="selection"/>
|
||||
<button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open"/>
|
||||
<button name="next_timebox" type="object" icon="gtk-go-forward" string="Next" states="draft,pending,open"/>
|
||||
<field name="planned_hours" widget="float_time"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<button name="%(project.wizard_close_task)d" states="draft,pending,open" string="Done" type="action" icon="gtk-jump-to" help="For changing to done state"/>
|
||||
<button groups="base.group_extended" name="%(project.wizard_delegate_task)d" states="pending,open" string="Delegate" type="action" icon="gtk-sort-descending"/>
|
||||
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel" help="For cancelling the task"/>
|
||||
<button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert" help="For reopening the tasks"/>
|
||||
</tree>
|
||||
@@ -123,11 +127,11 @@
|
||||
<field name="search_view_id" ref="project.view_task_search_form"/>
|
||||
</record>
|
||||
|
||||
<!-- <menuitem name="Todo List"
|
||||
<menuitem name="Todo List"
|
||||
groups="group_project_getting"
|
||||
id="menu_task_inbox"
|
||||
parent="project.menu_main"
|
||||
action="action_prject_task_tree"/>-->
|
||||
action="action_prject_task_tree"/>
|
||||
|
||||
<act_window name="My Inbox"
|
||||
domain="[('user_id', '=', uid),('state','in',('draft','open'))]"
|
||||
|
||||
Reference in New Issue
Block a user