Merge lp:~syleam/openobject-addons/5.0-improve-project-task into lp:openobject-addons/5.0

Proposed by Christophe CHAUVET
Status: Merged
Merged at revision: not available
Proposed branch: lp:~syleam/openobject-addons/5.0-improve-project-task
Merge into: lp:openobject-addons/5.0
Diff against target: None lines
To merge this branch: bzr merge lp:~syleam/openobject-addons/5.0-improve-project-task
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+4102@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

This improvement has been merged in Trunk, not in 5.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project/project.py'
2--- project/project.py 2009-02-04 13:12:10 +0000
3+++ project/project.py 2009-03-03 14:52:55 +0000
4@@ -271,7 +271,7 @@
5 'history': fields.function(_history_get, method=True, string="Task Details", type="text"),
6 'notes': fields.text('Notes'),
7
8- 'planned_hours': fields.float('Planned Hours', readonly=True, states={'draft':[('readonly',False)]}, required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
9+ 'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
10 'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', store=True, help="Computed using the sum of the task work done."),
11 'remaining_hours': fields.float('Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task."),
12 'total_hours': fields.function(_hours_get, method=True, string='Total Hours', multi='hours', store=True, help="Computed as: Time Spent + Remaining Time."),
13@@ -280,7 +280,7 @@
14
15 'user_id': fields.many2one('res.users', 'Assigned to'),
16 'partner_id': fields.many2one('res.partner', 'Partner'),
17- 'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done', readonly=False, states={'draft':[('readonly',True)]}),
18+ 'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'),
19 }
20 _defaults = {
21 'user_id': lambda obj,cr,uid,context: uid,
22
23=== modified file 'project/project_view.xml'
24--- project/project_view.xml 2009-02-19 10:58:47 +0000
25+++ project/project_view.xml 2009-03-03 14:52:55 +0000
26@@ -243,11 +243,11 @@
27 <field name="arch" type="xml">
28 <form string="Task edition">
29 <group colspan="6" col="6">
30- <field name="name" select="1"/>
31- <field name="project_id" required="1" select="1"/>
32- <field name="total_hours" widget="float_time"/>
33- <field name="user_id" select="1"/>
34- <field name="date_deadline" select="2"/>
35+ <field name="name" select="1" attrs="{'readonly':[('state','=','done')]}" />
36+ <field name="project_id" required="1" select="1" attrs="{'readonly':[('state','=','done')]}" />
37+ <field name="total_hours" widget="float_time" attrs="{'readonly':[('state','=','done')]}" />
38+ <field name="user_id" select="1" attrs="{'readonly':[('state','=','done')]}" />
39+ <field name="date_deadline" select="2" attrs="{'readonly':[('state','=','done')]}" />
40 <field name="progress" widget="progressbar"/>
41 </group>
42 <notebook colspan="4">
43@@ -256,6 +256,7 @@
44 <field
45 name="planned_hours"
46 widget="float_time"
47+ attrs="{'readonly':[('state','!=','draft')]}"
48 on_change="onchange_planned(planned_hours,effective_hours)"/>
49 <field name="remaining_hours" select="2" widget="float_time" attrs="{'readonly':[('state','!=','draft')]}" colspan="2"/>
50 <button name="%(action_config_compute_remaining)d" string="Review" type="action" colspan="1" target="new" states="open,pending"/>
51@@ -265,8 +266,15 @@
52 <field name="effective_hours" widget="float_time"/>
53 </group>
54
55- <field colspan="4" name="description" nolabel="1" select="2"/>
56- <field colspan="4" name="work_ids" nolabel="1"/>
57+ <field colspan="4" name="description" nolabel="1" select="2" attrs="{'readonly':[('state','=','done')]}" />
58+ <field colspan="4" name="work_ids" nolabel="1" attrs="{'readonly':[('state','in',['draft','done'])]}">
59+ <tree string="Task Work" editable="top">
60+ <field name="date" />
61+ <field name="user_id" />
62+ <field name="hours" widget="float_time" />
63+ <field name="name" />
64+ </tree>
65+ </field>
66 <newline/>
67 <group col="11" colspan="4">
68 <field name="state" select="1"/>
69@@ -282,7 +290,7 @@
70 </page>
71 <page groups="base.group_extended" string="Delegations">
72 <field colspan="4" name="history" nolabel="1"/>
73- <field colspan="4" height="150" name="child_ids" nolabel="1">
74+ <field colspan="4" height="150" name="child_ids" nolabel="1" attrs="{'readonly':[('state','!=','draft')]}">
75 <tree string="Delegated tasks">
76 <field name="name"/>
77 <field name="user_id"/>
78@@ -294,7 +302,7 @@
79 </field>
80 <field colspan="4" name="parent_id"/>
81 </page>
82- <page groups="base.group_extended" string="Extra Info">
83+ <page groups="base.group_extended" string="Extra Info" attrs="{'readonly':[('state','in',['draft','done'])]}">
84 <separator string="Planning" colspan="2"/>
85 <separator string="Dates" colspan="2"/>
86 <field name="priority"/>