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
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 task_record = self.browse(cr, uid, task_id, context=context)
6 if task_record.project_id:
7 project_follower_ids = [follower.id for follower in task_record.project_id.message_follower_ids]
8- self.message_subscribe(cr, uid, [task_id], project_follower_ids,
9+ self.message_subscribe(cr, uid, [task_id], project_follower_ids,
10 context=context)
11 self._store_history(cr, uid, [task_id], context=context)
12 self.create_send_note(cr, uid, [task_id], context=context)
13@@ -1354,16 +1354,15 @@
14 'use_tasks': True
15 }
16
17-
18-#
19-# Tasks History, used for cumulative flow charts (Lean/Agile)
20-#
21-
22 class project_task_history(osv.osv):
23+ """
24+ Tasks History, used for cumulative flow charts (Lean/Agile)
25+ """
26 _name = 'project.task.history'
27 _description = 'History of Tasks'
28 _rec_name = 'task_id'
29 _log_access = False
30+
31 def _get_date(self, cr, uid, ids, name, arg, context=None):
32 result = {}
33 for history in self.browse(cr, uid, ids, context=context):
34@@ -1415,35 +1414,38 @@
35 'date': fields.date.context_today,
36 }
37
38-
39 class project_task_history_cumulative(osv.osv):
40 _name = 'project.task.history.cumulative'
41 _table = 'project_task_history_cumulative'
42 _inherit = 'project.task.history'
43 _auto = False
44+
45 _columns = {
46 'end_date': fields.date('End Date'),
47- 'project_id': fields.related('task_id', 'project_id', string='Project', type='many2one', relation='project.project')
48+ 'project_id': fields.many2one('project.project', 'Project'),
49 }
50+
51 def init(self, cr):
52 cr.execute(""" CREATE OR REPLACE VIEW project_task_history_cumulative AS (
53 SELECT
54- history.date::varchar||'-'||history.history_id::varchar as id,
55- history.date as end_date,
56+ history.date::varchar||'-'||history.history_id::varchar AS id,
57+ history.date AS end_date,
58 *
59 FROM (
60 SELECT
61- id as history_id,
62- date+generate_series(0, CAST((coalesce(end_date,DATE 'tomorrow')::date - date)AS integer)-1) as date,
63- task_id, type_id, user_id, kanban_state, state,
64- greatest(remaining_hours,1) as remaining_hours, greatest(planned_hours,1) as planned_hours
65+ h.id AS history_id,
66+ h.date+generate_series(0, CAST((coalesce(h.end_date, DATE 'tomorrow')::date - h.date) AS integer)-1) AS date,
67+ h.task_id, h.type_id, h.user_id, h.kanban_state, h.state,
68+ greatest(h.remaining_hours, 1) AS remaining_hours, greatest(h.planned_hours, 1) AS planned_hours,
69+ t.project_id
70 FROM
71- project_task_history
72- ) as history
73+ project_task_history AS h
74+ JOIN project_task AS t ON (h.task_id = t.id)
75+
76+ ) AS history
77 )
78 """)
79
80-
81 class project_category(osv.osv):
82 """ Category of project's task (or issue) """
83 _name = "project.category"
84
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 </tree>
90 </field>
91 </record>
92+
93 <record id="view_task_history_graph" model="ir.ui.view">
94 <field name="name">project.task.history.cumulative.graph</field>
95 <field name="model">project.task.history.cumulative</field>
96 <field name="arch" type="xml">
97+ <!-- <field name="project_id"/> -->
98 <graph string="Project Tasks" type="bar">
99 <field name="date"/>
100 <field name="planned_hours" operator="+"/>
101@@ -29,21 +31,6 @@
102 </graph>
103 </field>
104 </record>
105-
106- <!-- Where is this object in py file ? -->
107-
108- <!--<record id="view_task_history_burndown_graph" model="ir.ui.view">-->
109- <!-- <field name="name">project.task.history.burndown.graph</field>-->
110- <!-- <field name="model">project.task.history.burndown</field>-->
111- <!-- <field name="arch" type="xml">-->
112- <!-- <graph string="Burndown Chart of Tasks" type="bar">-->
113- <!-- <field name="date"/>-->
114- <!-- <field name="remaining_hours" operator="+"/>-->
115- <!-- <field name="type_id" group="True"/>-->
116- <!-- </graph>-->
117- <!-- </field>-->
118- <!--</record>-->
119-
120
121 <record id="view_task_history_search" model="ir.ui.view">
122 <field name="name">project.task.history.cumulative.search</field>
123@@ -51,18 +38,18 @@
124 <field name="arch" type="xml">
125 <search string="Task's Analysis">
126 <field name="date"/>
127- <filter name="open" string="In Progress" domain="[('state','in',('open','draft'))]" help="In Progress Tasks" icon="terp-camera_test"/>
128- <filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-gtk-media-pause"/>
129- <separator/>
130- <filter name="kanban_blocked" string="Blocked" domain="[('kanban_state','=','blocked')]" icon="terp-gtk-media-pause"/>
131- <filter name="kanban_ready" string="Ready" domain="[('kanban_state','=','done')]" icon="terp-camera_test"/>
132- <separator/>
133- <filter string="My Tasks" domain="[('user_id','=',uid)]" help="My Tasks" icon="terp-personal" />
134- <filter string="Unassigned Tasks" domain="[('user_id','=',False)]" help="Unassigned Tasks" icon="terp-personal-" />
135- <separator/>
136- <filter string="My Projects" domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-personal"/>
137 <field name="project_id"/>
138 <field name="user_id"/>
139+ <filter name="open" string="In Progress Tasks" domain="[('state','in',('open','draft'))]"/>
140+ <filter string="Pending Tasks" domain="[('state','=','pending')]" context="{'show_delegated':False}"/>
141+ <separator/>
142+ <filter name="kanban_blocked" string="Blocked" domain="[('kanban_state','=','blocked')]"/>
143+ <filter name="kanban_ready" string="Ready" domain="[('kanban_state','=','done')]"/>
144+ <separator/>
145+ <filter string="My Tasks" domain="[('user_id','=',uid)]"/>
146+ <filter string="Unassigned Tasks" domain="[('user_id','=',False)]"/>
147+ <separator/>
148+ <filter string="My Projects" domain="[('project_id.user_id','=',uid)]"/>
149 </search>
150 </field>
151 </record>
152@@ -73,27 +60,12 @@
153 <field name="view_type">form</field>
154 <field name="view_mode">graph,tree</field>
155 <field name="view_id" ref="view_task_history_graph"/>
156- <field eval="False" name="filter"/>
157+ <field name="filter" eval="False"/>
158 <field name="context">{"search_default_open":1, "search_default_this_month": 1}</field>
159 </record>
160 <menuitem action="action_view_task_history_cumulative"
161 id="menu_action_view_task_history_cumulative"
162- parent="base.menu_project_report" />
163-
164-
165- <!--<record id="action_view_task_history_burndown" model="ir.actions.act_window">-->
166- <!-- <field name="name">Burndown Chart</field>-->
167- <!-- <field name="res_model">project.task.history.cumulative</field>-->
168- <!-- <field name="view_type">form</field>-->
169- <!-- <field name="view_mode">graph,tree</field>-->
170- <!-- <field name="view_id" ref="view_task_history_burndown_graph"/>-->
171- <!-- <field eval="False" name="filter"/>-->
172- <!-- <field name="context">{"search_default_open":1, "search_default_this_month": 1, "search_default_project_id": project_id}</field>-->
173- <!--</record>-->
174- <!--<menuitem action="action_view_task_history_burndown"-->
175- <!-- id="menu_action_view_task_history_burndown"-->
176- <!-- parent="project_report_task" />-->
177-
178+ parent="base.menu_project_report"/>
179
180 </data>
181 </openerp>

Subscribers

People subscribed via source and target branches

to all changes: