Merge lp:~openerp-dev/openobject-addons/trunk-bug-1022509-mdi into lp:openobject-addons
- trunk-bug-1022509-mdi
- Merge into trunk
Proposed by
Anto
Status: | Merged |
---|---|
Merged at revision: | 7740 |
Proposed branch: | lp:~openerp-dev/openobject-addons/trunk-bug-1022509-mdi |
Merge into: | lp:openobject-addons |
Diff against target: |
181 lines (+33/-59) 2 files modified
project/project.py (+19/-17) project/report/project_cumulative.xml (+14/-42) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1022509-mdi |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP Core Team | Pending | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
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 2012-10-09 15:54:20 +0000 | |||
3 | +++ project/project.py 2012-10-10 11:31:26 +0000 | |||
4 | @@ -1101,7 +1101,7 @@ | |||
5 | 1101 | task_record = self.browse(cr, uid, task_id, context=context) | 1101 | task_record = self.browse(cr, uid, task_id, context=context) |
6 | 1102 | if task_record.project_id: | 1102 | if task_record.project_id: |
7 | 1103 | project_follower_ids = [follower.id for follower in task_record.project_id.message_follower_ids] | 1103 | project_follower_ids = [follower.id for follower in task_record.project_id.message_follower_ids] |
9 | 1104 | self.message_subscribe(cr, uid, [task_id], project_follower_ids, | 1104 | self.message_subscribe(cr, uid, [task_id], project_follower_ids, |
10 | 1105 | context=context) | 1105 | context=context) |
11 | 1106 | self._store_history(cr, uid, [task_id], context=context) | 1106 | self._store_history(cr, uid, [task_id], context=context) |
12 | 1107 | self.create_send_note(cr, uid, [task_id], context=context) | 1107 | self.create_send_note(cr, uid, [task_id], context=context) |
13 | @@ -1354,16 +1354,15 @@ | |||
14 | 1354 | 'use_tasks': True | 1354 | 'use_tasks': True |
15 | 1355 | } | 1355 | } |
16 | 1356 | 1356 | ||
17 | 1357 | |||
18 | 1358 | # | ||
19 | 1359 | # Tasks History, used for cumulative flow charts (Lean/Agile) | ||
20 | 1360 | # | ||
21 | 1361 | |||
22 | 1362 | class project_task_history(osv.osv): | 1357 | class project_task_history(osv.osv): |
23 | 1358 | """ | ||
24 | 1359 | Tasks History, used for cumulative flow charts (Lean/Agile) | ||
25 | 1360 | """ | ||
26 | 1363 | _name = 'project.task.history' | 1361 | _name = 'project.task.history' |
27 | 1364 | _description = 'History of Tasks' | 1362 | _description = 'History of Tasks' |
28 | 1365 | _rec_name = 'task_id' | 1363 | _rec_name = 'task_id' |
29 | 1366 | _log_access = False | 1364 | _log_access = False |
30 | 1365 | |||
31 | 1367 | def _get_date(self, cr, uid, ids, name, arg, context=None): | 1366 | def _get_date(self, cr, uid, ids, name, arg, context=None): |
32 | 1368 | result = {} | 1367 | result = {} |
33 | 1369 | for history in self.browse(cr, uid, ids, context=context): | 1368 | for history in self.browse(cr, uid, ids, context=context): |
34 | @@ -1415,35 +1414,38 @@ | |||
35 | 1415 | 'date': fields.date.context_today, | 1414 | 'date': fields.date.context_today, |
36 | 1416 | } | 1415 | } |
37 | 1417 | 1416 | ||
38 | 1418 | |||
39 | 1419 | class project_task_history_cumulative(osv.osv): | 1417 | class project_task_history_cumulative(osv.osv): |
40 | 1420 | _name = 'project.task.history.cumulative' | 1418 | _name = 'project.task.history.cumulative' |
41 | 1421 | _table = 'project_task_history_cumulative' | 1419 | _table = 'project_task_history_cumulative' |
42 | 1422 | _inherit = 'project.task.history' | 1420 | _inherit = 'project.task.history' |
43 | 1423 | _auto = False | 1421 | _auto = False |
44 | 1422 | |||
45 | 1424 | _columns = { | 1423 | _columns = { |
46 | 1425 | 'end_date': fields.date('End Date'), | 1424 | 'end_date': fields.date('End Date'), |
48 | 1426 | 'project_id': fields.related('task_id', 'project_id', string='Project', type='many2one', relation='project.project') | 1425 | 'project_id': fields.many2one('project.project', 'Project'), |
49 | 1427 | } | 1426 | } |
50 | 1427 | |||
51 | 1428 | def init(self, cr): | 1428 | def init(self, cr): |
52 | 1429 | cr.execute(""" CREATE OR REPLACE VIEW project_task_history_cumulative AS ( | 1429 | cr.execute(""" CREATE OR REPLACE VIEW project_task_history_cumulative AS ( |
53 | 1430 | SELECT | 1430 | SELECT |
56 | 1431 | history.date::varchar||'-'||history.history_id::varchar as id, | 1431 | history.date::varchar||'-'||history.history_id::varchar AS id, |
57 | 1432 | history.date as end_date, | 1432 | history.date AS end_date, |
58 | 1433 | * | 1433 | * |
59 | 1434 | FROM ( | 1434 | FROM ( |
60 | 1435 | SELECT | 1435 | SELECT |
65 | 1436 | id as history_id, | 1436 | h.id AS history_id, |
66 | 1437 | date+generate_series(0, CAST((coalesce(end_date,DATE 'tomorrow')::date - date)AS integer)-1) as date, | 1437 | h.date+generate_series(0, CAST((coalesce(h.end_date, DATE 'tomorrow')::date - h.date) AS integer)-1) AS date, |
67 | 1438 | task_id, type_id, user_id, kanban_state, state, | 1438 | h.task_id, h.type_id, h.user_id, h.kanban_state, h.state, |
68 | 1439 | greatest(remaining_hours,1) as remaining_hours, greatest(planned_hours,1) as planned_hours | 1439 | greatest(h.remaining_hours, 1) AS remaining_hours, greatest(h.planned_hours, 1) AS planned_hours, |
69 | 1440 | t.project_id | ||
70 | 1440 | FROM | 1441 | FROM |
73 | 1441 | project_task_history | 1442 | project_task_history AS h |
74 | 1442 | ) as history | 1443 | JOIN project_task AS t ON (h.task_id = t.id) |
75 | 1444 | |||
76 | 1445 | ) AS history | ||
77 | 1443 | ) | 1446 | ) |
78 | 1444 | """) | 1447 | """) |
79 | 1445 | 1448 | ||
80 | 1446 | |||
81 | 1447 | class project_category(osv.osv): | 1449 | class project_category(osv.osv): |
82 | 1448 | """ Category of project's task (or issue) """ | 1450 | """ Category of project's task (or issue) """ |
83 | 1449 | _name = "project.category" | 1451 | _name = "project.category" |
84 | 1450 | 1452 | ||
85 | === modified file 'project/report/project_cumulative.xml' | |||
86 | --- project/report/project_cumulative.xml 2012-08-09 06:05:16 +0000 | |||
87 | +++ project/report/project_cumulative.xml 2012-10-10 11:31:26 +0000 | |||
88 | @@ -18,10 +18,12 @@ | |||
89 | 18 | </tree> | 18 | </tree> |
90 | 19 | </field> | 19 | </field> |
91 | 20 | </record> | 20 | </record> |
92 | 21 | |||
93 | 21 | <record id="view_task_history_graph" model="ir.ui.view"> | 22 | <record id="view_task_history_graph" model="ir.ui.view"> |
94 | 22 | <field name="name">project.task.history.cumulative.graph</field> | 23 | <field name="name">project.task.history.cumulative.graph</field> |
95 | 23 | <field name="model">project.task.history.cumulative</field> | 24 | <field name="model">project.task.history.cumulative</field> |
96 | 24 | <field name="arch" type="xml"> | 25 | <field name="arch" type="xml"> |
97 | 26 | <!-- <field name="project_id"/> --> | ||
98 | 25 | <graph string="Project Tasks" type="bar"> | 27 | <graph string="Project Tasks" type="bar"> |
99 | 26 | <field name="date"/> | 28 | <field name="date"/> |
100 | 27 | <field name="planned_hours" operator="+"/> | 29 | <field name="planned_hours" operator="+"/> |
101 | @@ -29,21 +31,6 @@ | |||
102 | 29 | </graph> | 31 | </graph> |
103 | 30 | </field> | 32 | </field> |
104 | 31 | </record> | 33 | </record> |
105 | 32 | |||
106 | 33 | <!-- Where is this object in py file ? --> | ||
107 | 34 | |||
108 | 35 | <!--<record id="view_task_history_burndown_graph" model="ir.ui.view">--> | ||
109 | 36 | <!-- <field name="name">project.task.history.burndown.graph</field>--> | ||
110 | 37 | <!-- <field name="model">project.task.history.burndown</field>--> | ||
111 | 38 | <!-- <field name="arch" type="xml">--> | ||
112 | 39 | <!-- <graph string="Burndown Chart of Tasks" type="bar">--> | ||
113 | 40 | <!-- <field name="date"/>--> | ||
114 | 41 | <!-- <field name="remaining_hours" operator="+"/>--> | ||
115 | 42 | <!-- <field name="type_id" group="True"/>--> | ||
116 | 43 | <!-- </graph>--> | ||
117 | 44 | <!-- </field>--> | ||
118 | 45 | <!--</record>--> | ||
119 | 46 | |||
120 | 47 | 34 | ||
121 | 48 | <record id="view_task_history_search" model="ir.ui.view"> | 35 | <record id="view_task_history_search" model="ir.ui.view"> |
122 | 49 | <field name="name">project.task.history.cumulative.search</field> | 36 | <field name="name">project.task.history.cumulative.search</field> |
123 | @@ -51,18 +38,18 @@ | |||
124 | 51 | <field name="arch" type="xml"> | 38 | <field name="arch" type="xml"> |
125 | 52 | <search string="Task's Analysis"> | 39 | <search string="Task's Analysis"> |
126 | 53 | <field name="date"/> | 40 | <field name="date"/> |
127 | 54 | <filter name="open" string="In Progress" domain="[('state','in',('open','draft'))]" help="In Progress Tasks" icon="terp-camera_test"/> | ||
128 | 55 | <filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-gtk-media-pause"/> | ||
129 | 56 | <separator/> | ||
130 | 57 | <filter name="kanban_blocked" string="Blocked" domain="[('kanban_state','=','blocked')]" icon="terp-gtk-media-pause"/> | ||
131 | 58 | <filter name="kanban_ready" string="Ready" domain="[('kanban_state','=','done')]" icon="terp-camera_test"/> | ||
132 | 59 | <separator/> | ||
133 | 60 | <filter string="My Tasks" domain="[('user_id','=',uid)]" help="My Tasks" icon="terp-personal" /> | ||
134 | 61 | <filter string="Unassigned Tasks" domain="[('user_id','=',False)]" help="Unassigned Tasks" icon="terp-personal-" /> | ||
135 | 62 | <separator/> | ||
136 | 63 | <filter string="My Projects" domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-personal"/> | ||
137 | 64 | <field name="project_id"/> | 41 | <field name="project_id"/> |
138 | 65 | <field name="user_id"/> | 42 | <field name="user_id"/> |
139 | 43 | <filter name="open" string="In Progress Tasks" domain="[('state','in',('open','draft'))]"/> | ||
140 | 44 | <filter string="Pending Tasks" domain="[('state','=','pending')]" context="{'show_delegated':False}"/> | ||
141 | 45 | <separator/> | ||
142 | 46 | <filter name="kanban_blocked" string="Blocked" domain="[('kanban_state','=','blocked')]"/> | ||
143 | 47 | <filter name="kanban_ready" string="Ready" domain="[('kanban_state','=','done')]"/> | ||
144 | 48 | <separator/> | ||
145 | 49 | <filter string="My Tasks" domain="[('user_id','=',uid)]"/> | ||
146 | 50 | <filter string="Unassigned Tasks" domain="[('user_id','=',False)]"/> | ||
147 | 51 | <separator/> | ||
148 | 52 | <filter string="My Projects" domain="[('project_id.user_id','=',uid)]"/> | ||
149 | 66 | </search> | 53 | </search> |
150 | 67 | </field> | 54 | </field> |
151 | 68 | </record> | 55 | </record> |
152 | @@ -73,27 +60,12 @@ | |||
153 | 73 | <field name="view_type">form</field> | 60 | <field name="view_type">form</field> |
154 | 74 | <field name="view_mode">graph,tree</field> | 61 | <field name="view_mode">graph,tree</field> |
155 | 75 | <field name="view_id" ref="view_task_history_graph"/> | 62 | <field name="view_id" ref="view_task_history_graph"/> |
157 | 76 | <field eval="False" name="filter"/> | 63 | <field name="filter" eval="False"/> |
158 | 77 | <field name="context">{"search_default_open":1, "search_default_this_month": 1}</field> | 64 | <field name="context">{"search_default_open":1, "search_default_this_month": 1}</field> |
159 | 78 | </record> | 65 | </record> |
160 | 79 | <menuitem action="action_view_task_history_cumulative" | 66 | <menuitem action="action_view_task_history_cumulative" |
161 | 80 | id="menu_action_view_task_history_cumulative" | 67 | id="menu_action_view_task_history_cumulative" |
178 | 81 | parent="base.menu_project_report" /> | 68 | parent="base.menu_project_report"/> |
163 | 82 | |||
164 | 83 | |||
165 | 84 | <!--<record id="action_view_task_history_burndown" model="ir.actions.act_window">--> | ||
166 | 85 | <!-- <field name="name">Burndown Chart</field>--> | ||
167 | 86 | <!-- <field name="res_model">project.task.history.cumulative</field>--> | ||
168 | 87 | <!-- <field name="view_type">form</field>--> | ||
169 | 88 | <!-- <field name="view_mode">graph,tree</field>--> | ||
170 | 89 | <!-- <field name="view_id" ref="view_task_history_burndown_graph"/>--> | ||
171 | 90 | <!-- <field eval="False" name="filter"/>--> | ||
172 | 91 | <!-- <field name="context">{"search_default_open":1, "search_default_this_month": 1, "search_default_project_id": project_id}</field>--> | ||
173 | 92 | <!--</record>--> | ||
174 | 93 | <!--<menuitem action="action_view_task_history_burndown"--> | ||
175 | 94 | <!-- id="menu_action_view_task_history_burndown"--> | ||
176 | 95 | <!-- parent="project_report_task" />--> | ||
177 | 96 | |||
179 | 97 | 69 | ||
180 | 98 | </data> | 70 | </data> |
181 | 99 | </openerp> | 71 | </openerp> |