Merge lp:~vauxoo/addons-vauxoo/7.0-management_reports-dev_sabrina into lp:addons-vauxoo/7.0
- 7.0-management_reports-dev_sabrina
- Merge into 7.0
Proposed by
Sabrina Romero - http://www.vauxoo.com
Status: | Merged |
---|---|
Merged at revision: | 1092 |
Proposed branch: | lp:~vauxoo/addons-vauxoo/7.0-management_reports-dev_sabrina |
Merge into: | lp:addons-vauxoo/7.0 |
Diff against target: |
366 lines (+310/-1) 8 files modified
user_story/__openerp__.py (+2/-0) user_story/model/__init__.py (+2/-0) user_story/model/custom_project_task.py (+77/-0) user_story/model/timesheet_all.py (+76/-0) user_story/security/ir.model.access.csv (+4/-1) user_story/security/userstory_security.xml (+5/-0) user_story/view/custom_project_task_view.xml (+71/-0) user_story/view/hr_timesheet_all_view.xml (+73/-0) |
To merge this branch: | bzr merge lp:~vauxoo/addons-vauxoo/7.0-management_reports-dev_sabrina |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jorge Angel Naranjo Rogel - http://www.vauxoo.com | Approve | ||
Sabrina Romero - http://www.vauxoo.com | Pending | ||
Moisés López - http://www.vauxoo.com | Pending | ||
Nhomar - Vauxoo | Pending | ||
Review via email: mp+227359@code.launchpad.net |
Commit message
Description of the change
SQL views added for management reports.
To post a comment you must log in.
Revision history for this message
Sabrina Romero - http://www.vauxoo.com (sabrina) wrote : | # |
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote : | # |
@Sabri,
Im agree.
Rafa should test it into runbot.
FYI I press button force build in: http://
- 1066. By Sabrina Romero - http://www.vauxoo.com
-
[MERGE] Merge with lp:addons-vauxoo/7.0
- 1067. By Sabrina Romero - http://www.vauxoo.com
-
[MERGE] lp:addons-vauxoo/7.0
- 1068. By Sabrina Romero - http://www.vauxoo.com
-
[FIX] Access rule added for model custom_
timesheet_ all.
Revision history for this message
Jorge Angel Naranjo Rogel - http://www.vauxoo.com (jorge-nr) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'user_story/__openerp__.py' |
2 | --- user_story/__openerp__.py 2014-06-06 21:19:51 +0000 |
3 | +++ user_story/__openerp__.py 2014-07-22 22:49:37 +0000 |
4 | @@ -60,6 +60,8 @@ |
5 | "view/userstory_view.xml", |
6 | "view/project_view.xml", |
7 | "view/hr_timesheet_view.xml", |
8 | + "view/hr_timesheet_all_view.xml", |
9 | + "view/custom_project_task_view.xml", |
10 | "data/data.xml", |
11 | "data/user_story_template.xml", |
12 | ], |
13 | |
14 | === modified file 'user_story/model/__init__.py' |
15 | --- user_story/model/__init__.py 2014-06-06 21:19:51 +0000 |
16 | +++ user_story/model/__init__.py 2014-07-22 22:49:37 +0000 |
17 | @@ -1,2 +1,4 @@ |
18 | import user_story |
19 | import timesheet |
20 | +import timesheet_all |
21 | +import custom_project_task |
22 | |
23 | === added file 'user_story/model/custom_project_task.py' |
24 | --- user_story/model/custom_project_task.py 1970-01-01 00:00:00 +0000 |
25 | +++ user_story/model/custom_project_task.py 2014-07-22 22:49:37 +0000 |
26 | @@ -0,0 +1,77 @@ |
27 | +# -*- coding: utf-8 -*- |
28 | +############################################################################## |
29 | +# |
30 | +# OpenERP, Open Source Management Solution |
31 | +# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/ |
32 | +# |
33 | +# This program is free software: you can redistribute it and/or modify |
34 | +# it under the terms of the GNU Affero General Public License as |
35 | +# published by the Free Software Foundation, either version 3 of the |
36 | +# License, or (at your option) any later version. |
37 | +# |
38 | +# This program is distributed in the hope that it will be useful, |
39 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
40 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
41 | +# GNU Affero General Public License for more details. |
42 | +# |
43 | +# You should have received a copy of the GNU Affero General Public License |
44 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
45 | +# |
46 | +############################################################################## |
47 | +import time |
48 | +import datetime |
49 | + |
50 | +from openerp.osv import fields, osv |
51 | +from openerp import pooler |
52 | +from openerp import tools |
53 | +from openerp.tools.translate import _ |
54 | + |
55 | +from openerp.tools.sql import drop_view_if_exists |
56 | + |
57 | +class custom_project_task(osv.Model): |
58 | + _name = "custom.project.task" |
59 | + _auto = False |
60 | + |
61 | + _columns = { |
62 | + 'analytic_id': fields.many2one('account.analytic.account', 'Project', |
63 | + readonly=True, select=True), |
64 | + 'counter': fields.integer('Num', readonly=True), |
65 | + 'userstory': fields.integer('User Story', readonly=True, |
66 | + help='User history id of user history assigned on task.'), |
67 | + 'task_user_id': fields.many2one('res.users', 'Task user', |
68 | + readonly=True, select=True, help='User of project task.'), |
69 | + 'project_leader_id': fields.many2one('res.users', 'Leader user', |
70 | + readonly=True, select=True, help='Leader user of project task.'), |
71 | + 'task_id': fields.many2one('project.task', 'Task', |
72 | + readonly=True, select=True, help='Project task title.'), |
73 | + 'deadline': fields.date('Deadline', readonly=True, |
74 | + help='Project task deadline.'), |
75 | + 'date_end': fields.date('Date End', readonly=True, |
76 | + help='Project task Date End.'), |
77 | + 'period_end': fields.char('Period End', 128, |
78 | + help='Period for the end date of summary work.'), |
79 | + 'state': fields.char('State', 128, help='Project task state.'), |
80 | + } |
81 | + |
82 | + def init(self, cr): |
83 | + drop_view_if_exists(cr, 'custom_project_task') |
84 | + cr.execute(''' |
85 | + create or replace view custom_project_task as ( |
86 | + SELECT |
87 | + 1 AS counter, |
88 | + task.id AS id, |
89 | + task.date_deadline AS deadline, |
90 | + task.user_id AS task_user_id, |
91 | + task.project_leader_id AS project_leader_id, |
92 | + task.date_end AS date_end, |
93 | + to_char(task.date_end,'MM/YYYY') AS period_end, |
94 | + analytic.id AS analytic_id, |
95 | + us.id AS userstory, |
96 | + task.id AS task_id, |
97 | + task_type.name AS state |
98 | + FROM project_task AS task |
99 | + LEFT JOIN project_project AS project ON project.id = task.project_id |
100 | + LEFT JOIN account_analytic_account AS analytic ON analytic.id = project.analytic_account_id |
101 | + LEFT JOIN user_story AS us ON us.id = task.userstory_id |
102 | + LEFT JOIN project_task_type AS task_type ON task_type.id = task.stage_id |
103 | + )''') |
104 | |
105 | === added file 'user_story/model/timesheet_all.py' |
106 | --- user_story/model/timesheet_all.py 1970-01-01 00:00:00 +0000 |
107 | +++ user_story/model/timesheet_all.py 2014-07-22 22:49:37 +0000 |
108 | @@ -0,0 +1,76 @@ |
109 | +# -*- coding: utf-8 -*- |
110 | +############################################################################## |
111 | +# |
112 | +# OpenERP, Open Source Management Solution |
113 | +# Copyright (c) 2014 Vauxoo - http://www.vauxoo.com/ |
114 | +# |
115 | +# This program is free software: you can redistribute it and/or modify |
116 | +# it under the terms of the GNU Affero General Public License as |
117 | +# published by the Free Software Foundation, either version 3 of the |
118 | +# License, or (at your option) any later version. |
119 | +# |
120 | +# This program is distributed in the hope that it will be useful, |
121 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
122 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
123 | +# GNU Affero General Public License for more details. |
124 | +# |
125 | +# You should have received a copy of the GNU Affero General Public License |
126 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
127 | +# |
128 | +############################################################################## |
129 | +import time |
130 | +import datetime |
131 | + |
132 | +from openerp.osv import fields, osv |
133 | +from openerp import pooler |
134 | +from openerp import tools |
135 | +from openerp.tools.translate import _ |
136 | + |
137 | +from openerp.tools.sql import drop_view_if_exists |
138 | + |
139 | +class custom_timesheet_all(osv.Model): |
140 | + _name = "custom.timesheet.all" |
141 | + _order = "date desc" |
142 | + _auto = False |
143 | + |
144 | + _columns = { |
145 | + 'period': fields.char('Period', 128, |
146 | + help='Period for the date of summary work.'), |
147 | + 'date': fields.date('Date', readonly=True, |
148 | + help='Date of summary work.'), |
149 | + 'analytic_id': fields.many2one('account.analytic.account', 'Project', |
150 | + readonly=True, select=True), |
151 | + 'userstory': fields.integer('User Story', readonly=True, |
152 | + help='User history id of user history assigned on task.'), |
153 | + 'task_id': fields.many2one('project.task', 'Task title', |
154 | + readonly=True, select=True, help='Project task title.'), |
155 | + 'user_id': fields.many2one('res.users', 'User', |
156 | + readonly=True, select=True, help='User of summary work.'), |
157 | + 'name': fields.char('Description', 264, help='Description of the summary work.'), |
158 | + 'unit_amount': fields.float('Duration', readonly=True, help='Time spent on work.'), |
159 | + 'invoiceable': fields.many2one('hr_timesheet_invoice.factor', 'Invoiceable', |
160 | + readonly=True, help='Definition of invoicing status of the line.'), |
161 | + } |
162 | + |
163 | + def init(self, cr): |
164 | + drop_view_if_exists(cr, 'custom_timesheet_all') |
165 | + cr.execute(''' |
166 | + create or replace view custom_timesheet_all as ( |
167 | + SELECT |
168 | + work.id AS id, |
169 | + to_char(work.date,'MM/YYYY') AS period, |
170 | + work.date AS date, |
171 | + analytic.id AS analytic_id, |
172 | + us.id AS userstory, |
173 | + task.id AS task_id, |
174 | + work.user_id AS user_id, |
175 | + work.name AS name, |
176 | + work.hours AS unit_amount, |
177 | + acc_anal_line.to_invoice AS invoiceable |
178 | + FROM project_task_work AS work |
179 | + LEFT JOIN hr_analytic_timesheet AS tsheet ON tsheet.id = work.hr_analytic_timesheet_id |
180 | + LEFT JOIN account_analytic_line AS acc_anal_line ON acc_anal_line.id = tsheet.line_id |
181 | + LEFT JOIN account_analytic_account AS analytic ON analytic.id = acc_anal_line.account_id |
182 | + LEFT JOIN project_task AS task ON task.id = work.task_id |
183 | + LEFT JOIN user_story AS us ON us.id = task.userstory_id |
184 | + )''') |
185 | |
186 | === modified file 'user_story/security/ir.model.access.csv' |
187 | --- user_story/security/ir.model.access.csv 2014-06-06 21:19:51 +0000 |
188 | +++ user_story/security/ir.model.access.csv 2014-07-22 22:49:37 +0000 |
189 | @@ -5,4 +5,7 @@ |
190 | "access_acceptability_criteria_manager","acceptability.criteria.manager","model_acceptability_criteria","user_story.group_user_story_manager",1,1,1,1 |
191 | "access_user_story_priority_manager","user.story.priority.manager","model_user_story_priority","user_story.group_user_story_manager",1,1,1,1 |
192 | "access_user_story_priority_user","user.story.priority.user","model_user_story_priority","user_story.group_user_story_user",1,0,0,0 |
193 | -access_hr_custom_timesheet,custom.timesheet,model_custom_timesheet,base.group_hr_user,1,1,1,1 |
194 | +"access_user_story_priority_user","user.story.priority.user","model_user_story_priority","user_story.group_user_story_user",1,0,0,0 |
195 | +"access_hr_custom_timesheet","custom.timesheet","model_custom_timesheet","base.group_hr_user",1,1,1,1 |
196 | +"access_hr_custom_timesheet_all","custom.timesheet.all","model_custom_timesheet_all","base.group_hr_user",1,1,1,1 |
197 | +"access_management_reports","management.reports","model_custom_project_task","user_story.group_management_reports",1,0,0,0 |
198 | |
199 | === modified file 'user_story/security/userstory_security.xml' |
200 | --- user_story/security/userstory_security.xml 2013-08-20 20:14:18 +0000 |
201 | +++ user_story/security/userstory_security.xml 2014-07-22 22:49:37 +0000 |
202 | @@ -20,5 +20,10 @@ |
203 | eval="[(6,0,[ref('user_story.group_user_story_user')])]"/> |
204 | </record> |
205 | |
206 | + <record id="group_management_reports" model="res.groups"> |
207 | + <field name="name">Management Reports</field> |
208 | + <field name="category_id" ref="module_user_story"/> |
209 | + </record> |
210 | + |
211 | </data> |
212 | </openerp> |
213 | |
214 | === added file 'user_story/view/custom_project_task_view.xml' |
215 | --- user_story/view/custom_project_task_view.xml 1970-01-01 00:00:00 +0000 |
216 | +++ user_story/view/custom_project_task_view.xml 2014-07-22 22:49:37 +0000 |
217 | @@ -0,0 +1,71 @@ |
218 | +<?xml version="1.0" encoding="utf-8"?> |
219 | +<openerp> |
220 | + <data> |
221 | + |
222 | + <record id="custom_project_task_tree" model="ir.ui.view"> |
223 | + <field name="name">custom.project.task.tree</field> |
224 | + <field name="model">custom.project.task</field> |
225 | + <field name="arch" type="xml"> |
226 | + <tree editable="top" create='false' edit='false' string="Project Task"> |
227 | + <field name="deadline"/> |
228 | + <field name="task_user_id"/> |
229 | + <field name="project_leader_id"/> |
230 | + <field name="analytic_id"/> |
231 | + <field name="userstory"/> |
232 | + <field name="task_id" options='{"no_open": True}'/> |
233 | + <field name="state"/> |
234 | + </tree> |
235 | + </field> |
236 | + </record> |
237 | + |
238 | + <record id="custom_project_task_search" model="ir.ui.view"> |
239 | + <field name="name">custom.project.task.search</field> |
240 | + <field name="model">custom.project.task</field> |
241 | + <field name="arch" type="xml"> |
242 | + <search string="Project Task"> |
243 | + <field name="deadline"/> |
244 | + <field name="task_user_id"/> |
245 | + <field name="project_leader_id"/> |
246 | + <field name="analytic_id"/> |
247 | + <field name="userstory"/> |
248 | + <field name="task_id"/> |
249 | + <field name="state"/> |
250 | + <group expand="0" string="Group By..."> |
251 | + <filter string="Deadline" icon="terp-go-month" domain="[]" context="{'group_by':'deadline'}"/> |
252 | + <filter string="Task User" icon="terp-personal" domain="[]" context="{'group_by':'task_user_id'}"/> |
253 | + <filter string="Leader User" icon="terp-personal" domain="[]" context="{'group_by':'project_leader_id'}"/> |
254 | + <filter string="Project" icon="terp-go-month" domain="[]" context="{'group_by':'analytic_id'}"/> |
255 | + <filter string="User Story" icon="terp-personal" domain="[]" context="{'group_by':'userstory'}"/> |
256 | + <filter string="Task" icon="terp-personal" domain="[]" context="{'group_by':'task_id'}"/> |
257 | + <filter string="State" icon="terp-go-month" domain="[]" context="{'group_by':'state'}"/> |
258 | + </group> |
259 | + </search> |
260 | + </field> |
261 | + </record> |
262 | + |
263 | + <record model="ir.ui.view" id="view_project_line_task_graph"> |
264 | + <field name="name">Project Task Graph</field> |
265 | + <field name="model">custom.project.task</field> |
266 | + <field name="arch" type="xml"> |
267 | + <graph string="Project Task" type="bar" orientation="horizontal"> |
268 | + <field name="task_user_id" group="True"/> |
269 | + <field name="counter" operator="+"/> |
270 | + </graph> |
271 | + </field> |
272 | + </record> |
273 | + |
274 | + <record id="act_custom_project_task" model="ir.actions.act_window"> |
275 | + <field name="name">Project Task Report</field> |
276 | + <field name="type">ir.actions.act_window</field> |
277 | + <field name="res_model">custom.project.task</field> |
278 | + <field name="view_type">form</field> |
279 | + <field name="view_mode">tree,form,graph</field> |
280 | + <field name="context">{"search_default_today":1}</field> |
281 | + <field name="view_id" ref="custom_project_task_tree"/> |
282 | + </record> |
283 | + |
284 | + <menuitem id="menu_project_management_report" name="Project Reports" parent="base.menu_main_pm" sequence="9" groups="user_story.group_management_reports"/> |
285 | + <menuitem id="menu_custom_project_task" parent="menu_project_management_report" action="act_custom_project_task" sequence="1" groups="user_story.group_management_reports"/> |
286 | + |
287 | + </data> |
288 | +</openerp> |
289 | |
290 | === added file 'user_story/view/hr_timesheet_all_view.xml' |
291 | --- user_story/view/hr_timesheet_all_view.xml 1970-01-01 00:00:00 +0000 |
292 | +++ user_story/view/hr_timesheet_all_view.xml 2014-07-22 22:49:37 +0000 |
293 | @@ -0,0 +1,73 @@ |
294 | +<?xml version="1.0" encoding="utf-8"?> |
295 | +<openerp> |
296 | + <data> |
297 | + |
298 | + <record id="hr_timesheet_line_tree_all" model="ir.ui.view"> |
299 | + <field name="name">custom.timesheet.all.tree</field> |
300 | + <field name="model">custom.timesheet.all</field> |
301 | + <field name="arch" type="xml"> |
302 | + <tree editable="top" create='false' edit='false' string="Timesheet Activities All"> |
303 | + <field name="date"/> |
304 | + <field name="user_id" options='{"no_open": True}'/> |
305 | + <field name="analytic_id"/> |
306 | + <field name="userstory"/> |
307 | + <field name="task_id" options='{"no_open": True}'/> |
308 | + <field name="name"/> |
309 | + <field name="period"/> |
310 | + <field name="unit_amount" widget="float_time"/> |
311 | + <field name="invoiceable"/> |
312 | + </tree> |
313 | + </field> |
314 | + </record> |
315 | + |
316 | + <record id="hr_timesheet_line_all_search" model="ir.ui.view"> |
317 | + <field name="name">custom.timesheet.all.search</field> |
318 | + <field name="model">custom.timesheet.all</field> |
319 | + <field name="arch" type="xml"> |
320 | + <search string="Timesheet All"> |
321 | + <field name="date"/> |
322 | + <field name="user_id"/> |
323 | + <field name="analytic_id"/> |
324 | + <field name="userstory"/> |
325 | + <field name="task_id"/> |
326 | + <field name="name"/> |
327 | + <field name="period"/> |
328 | + <field name="invoiceable"/> |
329 | + <group expand="0" string="Group By..."> |
330 | + <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/> |
331 | + <filter string="Summary Work User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/> |
332 | + <filter string="Project" icon="terp-go-month" domain="[]" context="{'group_by':'analytic_id'}"/> |
333 | + <filter string="User Story" icon="terp-personal" domain="[]" context="{'group_by':'userstory'}"/> |
334 | + <filter string="Task" icon="terp-personal" domain="[]" context="{'group_by':'task_id'}"/> |
335 | + <filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period'}"/> |
336 | + <filter string="Invoiceable" icon="terp-go-month" domain="[]" context="{'group_by':'invoiceable'}"/> |
337 | + </group> |
338 | + </search> |
339 | + </field> |
340 | + </record> |
341 | + |
342 | + <record model="ir.ui.view" id="view_timesheet_line_all_graph"> |
343 | + <field name="name">Timesheet All Graph</field> |
344 | + <field name="model">custom.timesheet.all</field> |
345 | + <field name="arch" type="xml"> |
346 | + <graph string="Timesheet" type="bar" orientation="horizontal"> |
347 | + <field name="task_id" group="True"/> |
348 | + <field name= "unit_amount" operator="+"/> |
349 | + </graph> |
350 | + </field> |
351 | + </record> |
352 | + |
353 | + <record id="act_hr_timesheet_line_all" model="ir.actions.act_window"> |
354 | + <field name="name">Timesheet Activities All Report</field> |
355 | + <field name="type">ir.actions.act_window</field> |
356 | + <field name="res_model">custom.timesheet.all</field> |
357 | + <field name="view_type">form</field> |
358 | + <field name="view_mode">tree,form,graph</field> |
359 | + <field name="context">{"search_default_today":1}</field> |
360 | + <field name="view_id" ref="hr_timesheet_line_tree_all"/> |
361 | + </record> |
362 | + |
363 | + <menuitem id="menu_hr_working_hour_all" parent="hr_attendance.menu_hr_time_tracking" action="act_hr_timesheet_line_all" groups="user_story.group_management_reports"/> |
364 | + |
365 | + </data> |
366 | +</openerp> |
@Nhomar, @Moy
Consider appropriate that Jorge may be the reviewer of the flow for this MP?
I would take it to production since Rafael also need views.
Best regards!