Merge lp:~openerp-dev/openobject-addons/trunk-bug-1022509-mdi into lp:openobject-addons

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
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+128662@code.launchpad.net
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
=== modified file 'project/project.py'
--- project/project.py 2012-10-09 15:54:20 +0000
+++ project/project.py 2012-10-10 11:31:26 +0000
@@ -1101,7 +1101,7 @@
1101 task_record = self.browse(cr, uid, task_id, context=context)1101 task_record = self.browse(cr, uid, task_id, context=context)
1102 if task_record.project_id:1102 if task_record.project_id:
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]
1104 self.message_subscribe(cr, uid, [task_id], project_follower_ids, 1104 self.message_subscribe(cr, uid, [task_id], project_follower_ids,
1105 context=context)1105 context=context)
1106 self._store_history(cr, uid, [task_id], context=context)1106 self._store_history(cr, uid, [task_id], context=context)
1107 self.create_send_note(cr, uid, [task_id], context=context)1107 self.create_send_note(cr, uid, [task_id], context=context)
@@ -1354,16 +1354,15 @@
1354 'use_tasks': True1354 'use_tasks': True
1355 }1355 }
13561356
1357
1358#
1359# Tasks History, used for cumulative flow charts (Lean/Agile)
1360#
1361
1362class project_task_history(osv.osv):1357class project_task_history(osv.osv):
1358 """
1359 Tasks History, used for cumulative flow charts (Lean/Agile)
1360 """
1363 _name = 'project.task.history'1361 _name = 'project.task.history'
1364 _description = 'History of Tasks'1362 _description = 'History of Tasks'
1365 _rec_name = 'task_id'1363 _rec_name = 'task_id'
1366 _log_access = False1364 _log_access = False
1365
1367 def _get_date(self, cr, uid, ids, name, arg, context=None):1366 def _get_date(self, cr, uid, ids, name, arg, context=None):
1368 result = {}1367 result = {}
1369 for history in self.browse(cr, uid, ids, context=context):1368 for history in self.browse(cr, uid, ids, context=context):
@@ -1415,35 +1414,38 @@
1415 'date': fields.date.context_today,1414 'date': fields.date.context_today,
1416 }1415 }
14171416
1418
1419class project_task_history_cumulative(osv.osv):1417class project_task_history_cumulative(osv.osv):
1420 _name = 'project.task.history.cumulative'1418 _name = 'project.task.history.cumulative'
1421 _table = 'project_task_history_cumulative'1419 _table = 'project_task_history_cumulative'
1422 _inherit = 'project.task.history'1420 _inherit = 'project.task.history'
1423 _auto = False1421 _auto = False
1422
1424 _columns = {1423 _columns = {
1425 'end_date': fields.date('End Date'),1424 'end_date': fields.date('End Date'),
1426 'project_id': fields.related('task_id', 'project_id', string='Project', type='many2one', relation='project.project')1425 'project_id': fields.many2one('project.project', 'Project'),
1427 }1426 }
1427
1428 def init(self, cr):1428 def init(self, cr):
1429 cr.execute(""" CREATE OR REPLACE VIEW project_task_history_cumulative AS (1429 cr.execute(""" CREATE OR REPLACE VIEW project_task_history_cumulative AS (
1430 SELECT1430 SELECT
1431 history.date::varchar||'-'||history.history_id::varchar as id,1431 history.date::varchar||'-'||history.history_id::varchar AS id,
1432 history.date as end_date,1432 history.date AS end_date,
1433 *1433 *
1434 FROM (1434 FROM (
1435 SELECT1435 SELECT
1436 id as history_id,1436 h.id AS history_id,
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,
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,
1439 greatest(remaining_hours,1) as remaining_hours, greatest(planned_hours,1) as planned_hours1439 greatest(h.remaining_hours, 1) AS remaining_hours, greatest(h.planned_hours, 1) AS planned_hours,
1440 t.project_id
1440 FROM1441 FROM
1441 project_task_history1442 project_task_history AS h
1442 ) as history1443 JOIN project_task AS t ON (h.task_id = t.id)
1444
1445 ) AS history
1443 )1446 )
1444 """)1447 """)
14451448
1446
1447class project_category(osv.osv):1449class project_category(osv.osv):
1448 """ Category of project's task (or issue) """1450 """ Category of project's task (or issue) """
1449 _name = "project.category"1451 _name = "project.category"
14501452
=== modified file 'project/report/project_cumulative.xml'
--- project/report/project_cumulative.xml 2012-08-09 06:05:16 +0000
+++ project/report/project_cumulative.xml 2012-10-10 11:31:26 +0000
@@ -18,10 +18,12 @@
18 </tree>18 </tree>
19 </field>19 </field>
20 </record>20 </record>
21
21 <record id="view_task_history_graph" model="ir.ui.view">22 <record id="view_task_history_graph" model="ir.ui.view">
22 <field name="name">project.task.history.cumulative.graph</field>23 <field name="name">project.task.history.cumulative.graph</field>
23 <field name="model">project.task.history.cumulative</field>24 <field name="model">project.task.history.cumulative</field>
24 <field name="arch" type="xml">25 <field name="arch" type="xml">
26 <!-- <field name="project_id"/> -->
25 <graph string="Project Tasks" type="bar">27 <graph string="Project Tasks" type="bar">
26 <field name="date"/>28 <field name="date"/>
27 <field name="planned_hours" operator="+"/>29 <field name="planned_hours" operator="+"/>
@@ -29,21 +31,6 @@
29 </graph>31 </graph>
30 </field>32 </field>
31 </record>33 </record>
32
33 <!-- Where is this object in py file ? -->
34
35 <!--<record id="view_task_history_burndown_graph" model="ir.ui.view">-->
36 <!-- <field name="name">project.task.history.burndown.graph</field>-->
37 <!-- <field name="model">project.task.history.burndown</field>-->
38 <!-- <field name="arch" type="xml">-->
39 <!-- <graph string="Burndown Chart of Tasks" type="bar">-->
40 <!-- <field name="date"/>-->
41 <!-- <field name="remaining_hours" operator="+"/>-->
42 <!-- <field name="type_id" group="True"/>-->
43 <!-- </graph>-->
44 <!-- </field>-->
45 <!--</record>-->
46
4734
48 <record id="view_task_history_search" model="ir.ui.view">35 <record id="view_task_history_search" model="ir.ui.view">
49 <field name="name">project.task.history.cumulative.search</field>36 <field name="name">project.task.history.cumulative.search</field>
@@ -51,18 +38,18 @@
51 <field name="arch" type="xml">38 <field name="arch" type="xml">
52 <search string="Task's Analysis">39 <search string="Task's Analysis">
53 <field name="date"/>40 <field name="date"/>
54 <filter name="open" string="In Progress" domain="[('state','in',('open','draft'))]" help="In Progress Tasks" icon="terp-camera_test"/>
55 <filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-gtk-media-pause"/>
56 <separator/>
57 <filter name="kanban_blocked" string="Blocked" domain="[('kanban_state','=','blocked')]" icon="terp-gtk-media-pause"/>
58 <filter name="kanban_ready" string="Ready" domain="[('kanban_state','=','done')]" icon="terp-camera_test"/>
59 <separator/>
60 <filter string="My Tasks" domain="[('user_id','=',uid)]" help="My Tasks" icon="terp-personal" />
61 <filter string="Unassigned Tasks" domain="[('user_id','=',False)]" help="Unassigned Tasks" icon="terp-personal-" />
62 <separator/>
63 <filter string="My Projects" domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-personal"/>
64 <field name="project_id"/>41 <field name="project_id"/>
65 <field name="user_id"/>42 <field name="user_id"/>
43 <filter name="open" string="In Progress Tasks" domain="[('state','in',('open','draft'))]"/>
44 <filter string="Pending Tasks" domain="[('state','=','pending')]" context="{'show_delegated':False}"/>
45 <separator/>
46 <filter name="kanban_blocked" string="Blocked" domain="[('kanban_state','=','blocked')]"/>
47 <filter name="kanban_ready" string="Ready" domain="[('kanban_state','=','done')]"/>
48 <separator/>
49 <filter string="My Tasks" domain="[('user_id','=',uid)]"/>
50 <filter string="Unassigned Tasks" domain="[('user_id','=',False)]"/>
51 <separator/>
52 <filter string="My Projects" domain="[('project_id.user_id','=',uid)]"/>
66 </search>53 </search>
67 </field>54 </field>
68 </record>55 </record>
@@ -73,27 +60,12 @@
73 <field name="view_type">form</field>60 <field name="view_type">form</field>
74 <field name="view_mode">graph,tree</field>61 <field name="view_mode">graph,tree</field>
75 <field name="view_id" ref="view_task_history_graph"/>62 <field name="view_id" ref="view_task_history_graph"/>
76 <field eval="False" name="filter"/>63 <field name="filter" eval="False"/>
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>
78 </record>65 </record>
79 <menuitem action="action_view_task_history_cumulative"66 <menuitem action="action_view_task_history_cumulative"
80 id="menu_action_view_task_history_cumulative"67 id="menu_action_view_task_history_cumulative"
81 parent="base.menu_project_report" />68 parent="base.menu_project_report"/>
82
83
84 <!--<record id="action_view_task_history_burndown" model="ir.actions.act_window">-->
85 <!-- <field name="name">Burndown Chart</field>-->
86 <!-- <field name="res_model">project.task.history.cumulative</field>-->
87 <!-- <field name="view_type">form</field>-->
88 <!-- <field name="view_mode">graph,tree</field>-->
89 <!-- <field name="view_id" ref="view_task_history_burndown_graph"/>-->
90 <!-- <field eval="False" name="filter"/>-->
91 <!-- <field name="context">{"search_default_open":1, "search_default_this_month": 1, "search_default_project_id": project_id}</field>-->
92 <!--</record>-->
93 <!--<menuitem action="action_view_task_history_burndown"-->
94 <!-- id="menu_action_view_task_history_burndown"-->
95 <!-- parent="project_report_task" />-->
96
9769
98 </data>70 </data>
99</openerp>71</openerp>

Subscribers

People subscribed via source and target branches

to all changes: