[IMP] Cleaning and useability: project_gtd and crm_todo
bzr revid: fp@tinyerp.com-20111114104734-sqliojpjnmwuib27
This commit is contained in:
@@ -46,13 +46,15 @@
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="crm_todo_action">
|
||||
<field name="name">Todo List</field>
|
||||
<field name="name">My Tasks</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="context">{'set_editable':True,'set_visible':True,'gtd':True,'user_invisible':True, 'search_default_user_id':uid, "search_default_current": 1, "search_default_open": 1, "lead_id": 1}</field>
|
||||
<field name="context">{'set_editable':True,'set_visible':True,'gtd':True,'user_invisible':True, "search_default_open": 1, "lead_id": 1}</field>
|
||||
<field name="search_view_id" ref="project_gtd.view_task_gtd_search"/>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,calendar,gantt,graph,kanban</field>
|
||||
</record>
|
||||
<menuitem name="Tasks"
|
||||
<menuitem
|
||||
id="menu_crm_todo"
|
||||
parent="base.menu_sales"
|
||||
action="crm_todo_action"/>
|
||||
|
||||
@@ -414,7 +414,6 @@
|
||||
<field name="date_end" invisible="1"/>
|
||||
<field name="progress" widget="progressbar" invisible="context.get('set_visible',False)"/>
|
||||
<field name="state" invisible="context.get('set_visible',False)"/>
|
||||
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel" help="For cancelling the task"/>
|
||||
<button name="do_open" states="pending,draft,done,cancelled" string="Start Task" type="object" icon="gtk-media-play" help="For changing to open state" invisible="context.get('set_visible',False)"/>
|
||||
<button groups="base.group_extended" name="%(action_project_task_delegate)d" states="pending,open,draft" string="Delegate" type="action" icon="gtk-sort-descending" help="For changing to delegate state"/>
|
||||
<button name="action_close" states="draft,pending,open" string="Done" type="object" icon="terp-dialog-close" help="For changing to done state"/>
|
||||
@@ -467,7 +466,7 @@
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Task Edition">
|
||||
<search string="Tasks">
|
||||
<group>
|
||||
<filter name="draft" string="New" domain="[('state','=','draft')]" help="New Tasks" icon="terp-check"/>
|
||||
<filter name="open" string="In Progress" domain="[('state','=','open')]" help="In Progress Tasks" icon="terp-camera_test"/>
|
||||
|
||||
@@ -106,25 +106,17 @@ class project_task(osv.osv):
|
||||
timebox_obj = self.pool.get('project.gtd.timebox')
|
||||
if (res['type'] == 'search') and context.get('gtd', False):
|
||||
tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[]), context=context)
|
||||
search_extended ='''<newline/>'''
|
||||
search_extended += '''<filter domain="[('timebox_id','=', False)]" context="{'set_editable':True,'set_visible':True,'user_invisible':True}" icon="gtk-new" help="Undefined Timebox" string="%s"/>''' % (_('Inbox'),)
|
||||
search_extended += '''<separator orientation="vertical"/>'''
|
||||
search_extended =''
|
||||
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 + '''" context="{'user_invisible': True}"/>'''
|
||||
search_extended += '''
|
||||
<separator orientation="vertical"/>
|
||||
<field name="context_id" select="1" widget="selection"/>
|
||||
</search>'''
|
||||
search_extended += '''<filter domain="[('timebox_id','=', ''' + str(time.id) + ''')]" icon="''' + icon + '''" string="''' + time.name + '''" context="{'user_invisible': True}"/>\n'''
|
||||
search_extended +='''<separator orientation="vertical"/>'''
|
||||
|
||||
res['arch'] = res['arch'].replace('<separator name="gtdsep"/>', search_extended)
|
||||
|
||||
res['arch'] = unicode(res['arch'], 'utf8').replace('</search>', search_extended)
|
||||
attrs_sel = self.pool.get('project.gtd.context').name_search(cr, uid, '', [], context=context)
|
||||
context_id_info = self.pool.get('project.task').fields_get(cr, uid, ['context_id'], context=context)
|
||||
context_id_info['context_id']['selection'] = attrs_sel
|
||||
res['fields'].update(context_id_info)
|
||||
return res
|
||||
|
||||
project_task()
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
<field name="name">This Week</field>
|
||||
<field name="icon">terp-go-week</field>
|
||||
</record>
|
||||
<record model="project.gtd.timebox" id="timebox_monthly">
|
||||
<field name="name">This Month</field>
|
||||
<field name="icon">terp-go-month</field>
|
||||
</record>
|
||||
<record model="project.gtd.timebox" id="timebox_lt">
|
||||
<field name="name">Long Term</field>
|
||||
<field name="icon">terp-project</field>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<field string="Timebox" name="timebox_id" invisible=" not context.get('gtd', False)"/>
|
||||
<button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open" invisible=" not context.get('gtd',False)"/>
|
||||
<button name="next_timebox" type="object" icon="gtk-go-forward" string="Next" states="draft,pending,open" invisible=" not context.get('gtd',False)"/>
|
||||
<field name="context_id" invisible="not context.get('gtd', False)" widget="selection"/>
|
||||
<field name="context_id" invisible="not context.get('context_show', False)" widget="selection" groups="base.group_extended"/>
|
||||
<button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert" help="For reopening the tasks" invisible="not context.get('set_visible',False)"/>
|
||||
</field>
|
||||
</field>
|
||||
@@ -101,11 +101,40 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_task_gtd_search" model="ir.ui.view">
|
||||
<field name="name">project.task.gtd.search</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">search</field>
|
||||
<field name="priority">50</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="My Tasks">
|
||||
<filter name="open" string="In Progress" domain="[('state','in',('draft','open'))]" help="In Progress and draft tasks" icon="terp-camera_test"/>
|
||||
<filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-gtk-media-pause"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter
|
||||
domain="[('timebox_id','=', False)]"
|
||||
help="Undefined Timebox" string="Inbox"/>
|
||||
<separator name="gtdsep"/>
|
||||
<filter string="Deadlines" context="{'deadline_visible': False}" domain="[('date_deadline','<>',False)]" help="Show only tasks having a deadline" icon="terp-gnome-cpu-frequency-applet+"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="context_id" widget="selection" groups="base.group_extended"
|
||||
context="{'context_show': True}">
|
||||
<filter string="Show Context"
|
||||
name="context_show"
|
||||
context="{'context_show': True}"
|
||||
domain="[]" icon="terp-camera_test"
|
||||
help="Show the context field"/>
|
||||
</field>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="open_gtd_task">
|
||||
<field name="name">Todo List</field>
|
||||
<field name="name">My Tasks</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="context">{'set_editable':True,'set_visible':True,'gtd':True,'user_invisible':True, 'search_default_user_id':uid, "search_default_draft": 1, "search_default_open": 1}</field>
|
||||
<field name="search_view_id" ref="view_task_gtd_search"/>
|
||||
<field name="context">{'set_editable':True,'set_visible':True,'gtd':True,'user_invisible':True, "search_default_open": 1}</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,calendar,gantt,graph,kanban</field>
|
||||
</record>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-
|
||||
Create a task 'Develop time management module' with monthly timebox
|
||||
Create a task 'Develop time management module' with weekly timebox
|
||||
-
|
||||
!record {model: project.task, id: project_task_developtimemanagementmodule0}:
|
||||
name: Develop time management module
|
||||
@@ -7,7 +7,7 @@
|
||||
project_id: project.project_project_22
|
||||
remaining_hours: 15.0
|
||||
state: draft
|
||||
timebox_id: project_gtd.timebox_monthly
|
||||
timebox_id: project_gtd.timebox_weekly
|
||||
|
||||
|
||||
-
|
||||
@@ -36,12 +36,12 @@
|
||||
sequence: 0.0
|
||||
|
||||
-
|
||||
Planify the task from monthly timebox to tomorrow timebox
|
||||
Planify the task from weekly timebox to tomorrow timebox
|
||||
-
|
||||
!record {model: project.timebox.fill.plan, id: project_timebox_fill_plan_0}:
|
||||
task_ids:
|
||||
- project_task_developtimemanagementmodule0
|
||||
timebox_id: project_gtd.timebox_monthly
|
||||
timebox_id: project_gtd.timebox_weekly
|
||||
timebox_to_id: project_gtd_timebox_tomorrow1
|
||||
|
||||
|
||||
@@ -75,4 +75,4 @@
|
||||
Check task 'Develop time management module' is no more in tomorrow timebox
|
||||
-
|
||||
!assert {model: project.task, id: project_task_developtimemanagementmodule0, string: Task is not in tomorrow timebox}:
|
||||
- timebox_id.id != ref("project_gtd_timebox_tomorrow1")
|
||||
- timebox_id.id != ref("project_gtd_timebox_tomorrow1")
|
||||
|
||||
Reference in New Issue
Block a user