Merge lp:~akretion-team/project-service/project-service-port-functionnal-block into lp:~project-core-editors/project-service/trunk
- project-service-port-functionnal-block
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 34 |
Proposed branch: | lp:~akretion-team/project-service/project-service-port-functionnal-block |
Merge into: | lp:~project-core-editors/project-service/trunk |
Diff against target: |
376 lines (+122/-76) 8 files modified
project_functional_block/__init__.py (+2/-2) project_functional_block/__openerp__.py (+21/-17) project_functional_block/project.py (+49/-22) project_functional_block/project_demo.xml (+21/-0) project_functional_block/project_view.xml (+23/-20) project_functional_block/security/ir.model.access.csv (+2/-2) project_issue_service/project_issue.py (+1/-1) project_task_service/project_task.py (+3/-12) |
To merge this branch: | bzr merge lp:~akretion-team/project-service/project-service-port-functionnal-block |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Reis | lgtm | Approve | |
Raphaël Valyi - http://www.akretion.com | Approve | ||
Review via email:
|
Commit message
Description of the change
Port project functionnal block to 7 version.
- 36. By Sébastien BEAU - http://www.akretion.com
-
[REF] port view on 7
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote : | # |
I clean the view
- 37. By Sébastien BEAU - http://www.akretion.com
-
[IMP] add demo data
- 38. By Sébastien BEAU - http://www.akretion.com
-
[REF] rename project_
functional_ blocks into project_ functional_ block
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote : | # |
I add some demo data and also I rename the module (remove the useless "s")
Regarding the name of the object "project.
Thanks
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Reis (dreis-pt) wrote : | # |
Good question.
I grepped the addons, and IMHO it would be more consistent to use "project.
- 39. By Sébastien BEAU - http://www.akretion.com
-
[REF] rename project.
functional_ block into project. functional. block
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote : | # |
Done ;)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : | # |
Thanks Seb, seems all right; tested.
- 40. By David BEAL (ak)
-
[FIX] replace project.
functional_ block by project. functional. block - 41. By David BEAL (ak)
-
[FIX] rename project.
functional_ block in project. functional. block in roject_task_service - 42. By David BEAL (ak)
-
[FIX] rename project.
functional_ block in project. functional. block in project_ issue_service
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Reis (dreis-pt) : | # |
Preview Diff
1 | === renamed directory '__unported__/project_functional_blocks' => 'project_functional_block' |
2 | === modified file 'project_functional_block/__init__.py' |
3 | --- __unported__/project_functional_blocks/__init__.py 2012-07-12 07:42:28 +0000 |
4 | +++ project_functional_block/__init__.py 2014-03-25 15:51:09 +0000 |
5 | @@ -3,7 +3,7 @@ |
6 | # |
7 | # OpenERP, Open Source Management Solution |
8 | # Copyright (C) 2010 Akretion LDTA (<http://www.akretion.com>). |
9 | -# |
10 | +# |
11 | # |
12 | # This program is free software: you can redistribute it and/or modify |
13 | # it under the terms of the GNU Affero General Public License as |
14 | @@ -20,6 +20,6 @@ |
15 | # |
16 | ############################################################################## |
17 | |
18 | -import project |
19 | +from . import project |
20 | |
21 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
22 | |
23 | === modified file 'project_functional_block/__openerp__.py' (properties changed: +x to -x) |
24 | --- __unported__/project_functional_blocks/__openerp__.py 2013-03-04 16:16:31 +0000 |
25 | +++ project_functional_block/__openerp__.py 2014-03-25 15:51:09 +0000 |
26 | @@ -18,22 +18,26 @@ |
27 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
28 | # |
29 | ############################################################################## |
30 | -{ |
31 | - "name": "Project requiring functional blocks", |
32 | - "version": "1.1dr", |
33 | - "author": "Akretion", |
34 | - "website": "http://www.openerp.com", |
35 | - "category": "project Management", |
36 | - "depends": ["project"], |
37 | - "description": """\ |
38 | + |
39 | +{'name': 'Project requiring functional blocks', |
40 | + 'version': '1.2', |
41 | + 'author': 'Akretion', |
42 | + 'website': 'www.akretion.com', |
43 | + 'license': 'AGPL-3', |
44 | + 'category': 'Generic Modules', |
45 | + 'description': """ |
46 | Adds functional blocks to organize the projects tasks. |
47 | -(fork from lp:~akretion-team/+junk/advanced-project-management) |
48 | - """, |
49 | - "demo_xml": [], |
50 | - "update_xml": [ |
51 | - "security/ir.model.access.csv", |
52 | - "project_view.xml", |
53 | - ], |
54 | - 'installable': False, |
55 | + """, |
56 | + 'depends': [ |
57 | + 'project', |
58 | + ], |
59 | + 'data': [ |
60 | + 'security/ir.model.access.csv', |
61 | + 'project_view.xml', |
62 | + ], |
63 | + 'demo': [ |
64 | + 'project_demo.xml', |
65 | + ], |
66 | + 'installable': True, |
67 | + 'application': True, |
68 | } |
69 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
70 | |
71 | === modified file 'project_functional_block/project.py' (properties changed: +x to -x) |
72 | --- __unported__/project_functional_blocks/project.py 2012-11-22 13:15:34 +0000 |
73 | +++ project_functional_block/project.py 2014-03-25 15:51:09 +0000 |
74 | @@ -1,40 +1,67 @@ |
75 | # -*- coding: utf-8 -*- |
76 | -from osv import fields, osv |
77 | - |
78 | -class project_functional_block(osv.osv): |
79 | - _name = 'project.functional_block' |
80 | +############################################################################## |
81 | +# |
82 | +# OpenERP, Open Source Management Solution |
83 | +# Copyright (C) 2010 Akretion LDTA (<http://www.akretion.com>). |
84 | +# |
85 | +# |
86 | +# This program is free software: you can redistribute it and/or modify |
87 | +# it under the terms of the GNU Affero General Public License as |
88 | +# published by the Free Software Foundation, either version 3 of the |
89 | +# License, or (at your option) any later version. |
90 | +# |
91 | +# This program is distributed in the hope that it will be useful, |
92 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
93 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
94 | +# GNU Affero General Public License for more details. |
95 | +# |
96 | +# You should have received a copy of the GNU Affero General Public License |
97 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
98 | +# |
99 | +############################################################################## |
100 | + |
101 | +from openerp.osv import fields, orm |
102 | + |
103 | + |
104 | +class project_functional_block(orm.Model): |
105 | + _name = 'project.functional.block' |
106 | _description = 'Functional block to organize projects tasks' |
107 | |
108 | def name_get(self, cr, uid, ids, context=None): |
109 | res = [] |
110 | - for row in self.read(cr, uid, ids, ['name','parent_id'], context=context): |
111 | + for row in self.read(cr, uid, ids, ['name', 'parent_id'], context=context): |
112 | parent = row['parent_id'] and (row['parent_id'][1]+' / ') or '' |
113 | res.append((row['id'], parent + row['name'])) |
114 | return res |
115 | - |
116 | + |
117 | def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): |
118 | - return dict( self.name_get(cr, uid, ids, context=context) ) |
119 | + return dict(self.name_get(cr, uid, ids, context=context)) |
120 | |
121 | _columns = { |
122 | 'name': fields.char('Name', size=64, required=True, translate=True), |
123 | + 'sequence': fields.integer('Sequence'), |
124 | 'description': fields.text('Description', translate=True), |
125 | - 'parent_id': fields.many2one('project.functional_block', 'Parent block', select=True), |
126 | - 'child_id': fields.one2many('project.functional_block', 'parent_id', 'Child block'), |
127 | - 'complete_name': fields.function(_name_get_fnc, method=True, type='char', string='Name'), |
128 | + 'parent_id': fields.many2one( |
129 | + 'project.functional.block', |
130 | + 'Parent block'), |
131 | + 'child_id': fields.one2many( |
132 | + 'project.functional.block', |
133 | + 'parent_id', |
134 | + 'Child block'), |
135 | + 'complete_name': fields.function( |
136 | + _name_get_fnc, |
137 | + method=True, |
138 | + type='char', |
139 | + string='Name'), |
140 | 'code': fields.char('Code', size=10), |
141 | } |
142 | - _order = 'parent_id,name' |
143 | - |
144 | - |
145 | -project_functional_block() |
146 | - |
147 | -class project_task(osv.osv): |
148 | + _order = 'parent_id, sequence, name' |
149 | + |
150 | + |
151 | +class project_task(orm.Model): |
152 | _inherit = 'project.task' |
153 | _columns = { |
154 | - 'functional_block_id': fields.many2one('project.functional_block', 'Functional Block'), |
155 | + 'functional_block_id': fields.many2one( |
156 | + 'project.functional.block', |
157 | + 'Functional Block'), |
158 | } |
159 | - _constraints = [ |
160 | - (osv.osv._check_recursion, 'Error! Cannot create recursive cycle.', ['parent_id']) |
161 | - ] |
162 | - |
163 | -project_task() |
164 | |
165 | === added file 'project_functional_block/project_demo.xml' |
166 | --- project_functional_block/project_demo.xml 1970-01-01 00:00:00 +0000 |
167 | +++ project_functional_block/project_demo.xml 2014-03-25 15:51:09 +0000 |
168 | @@ -0,0 +1,21 @@ |
169 | +<?xml version="1.0" encoding="UTF-8"?> |
170 | +<openerp> |
171 | + <data> |
172 | + |
173 | + <record id="functional_block_1" model="project.functional.block"> |
174 | + <field name="name">WMS</field> |
175 | + <field name="description">Warehouse Management System</field> |
176 | + </record> |
177 | + |
178 | + <record id="functional_block_2" model="project.functional.block"> |
179 | + <field name="name">CRM</field> |
180 | + <field name="description">Customer Relationship Management</field> |
181 | + </record> |
182 | + |
183 | + <record id="functional_block_3" model="project.functional.block"> |
184 | + <field name="name">Accounting</field> |
185 | + <field name="description">Accounting</field> |
186 | + </record> |
187 | + |
188 | + </data> |
189 | +</openerp> |
190 | |
191 | === modified file 'project_functional_block/project_view.xml' |
192 | --- __unported__/project_functional_blocks/project_view.xml 2012-07-12 07:42:28 +0000 |
193 | +++ project_functional_block/project_view.xml 2014-03-25 15:51:09 +0000 |
194 | @@ -7,8 +7,8 @@ |
195 | <field name="type">form</field> |
196 | <field name="inherit_id" ref="project.view_task_form2"/> |
197 | <field name="arch" type="xml"> |
198 | - <xpath expr="/form/group/field[@name='progress']" position="after"> |
199 | - <field name="functional_block_id" select="1"/> |
200 | + <xpath expr="/form/sheet/group/group/field[@name='progress']" position="after"> |
201 | + <field name="functional_block_id"/> |
202 | </xpath> |
203 | </field> |
204 | </record> |
205 | @@ -20,7 +20,7 @@ |
206 | <field name="inherit_id" ref="project.view_task_tree2"/> |
207 | <field name="arch" type="xml"> |
208 | <field name="user_id" position="after"> |
209 | - <field name="functional_block_id" select="1"/> |
210 | + <field name="functional_block_id"/> |
211 | </field> |
212 | </field> |
213 | </record> |
214 | @@ -31,10 +31,10 @@ |
215 | <field name="type">search</field> |
216 | <field name="inherit_id" ref="project.view_task_search_form"/> |
217 | <field name="arch" type="xml"> |
218 | - <xpath expr="/search/group/field[@name='name']" position="after"> |
219 | + <xpath expr="//field[@name='name']" position="after"> |
220 | <field name="functional_block_id" select="1"/> |
221 | </xpath> |
222 | - <xpath expr="/search/group[@string='Group By...']/filter[@string='Project']" position="after"> |
223 | + <xpath expr="//filter[@string='Project']" position="after"> |
224 | <separator orientation="vertical"/> |
225 | <filter string="Functional Block" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'functional_block_id'}"/> |
226 | </xpath> |
227 | @@ -44,8 +44,8 @@ |
228 | <!-- FUNCTIONAL BLOCK --> |
229 | <!-- Search view for software module --> |
230 | <record id="funct_block_search_view" model="ir.ui.view"> |
231 | - <field name="name">project.functional_block.search</field> |
232 | - <field name="model">project.functional_block</field> |
233 | + <field name="name">project.functional.block.search</field> |
234 | + <field name="model">project.functional.block</field> |
235 | <field name="type">search</field> |
236 | <field name="arch" type="xml"> |
237 | <search string="Search software's module"> |
238 | @@ -64,28 +64,31 @@ |
239 | |
240 | <!-- tree view for functional block --> |
241 | <record model="ir.ui.view" id="funct_block_list_view"> |
242 | - <field name="name">project.functional_block.list</field> |
243 | - <field name="model">project.functional_block</field> |
244 | + <field name="name">project.functional.block.list</field> |
245 | + <field name="model">project.functional.block</field> |
246 | <field name="type">tree</field> |
247 | <field name="arch" type="xml"> |
248 | <tree string="Functionality categories" > |
249 | - <field name="name"/> |
250 | - <field name="parent_id"/> |
251 | + <field name="name"/> |
252 | + <field name="parent_id"/> |
253 | + <field name="sequence" invisible="True"/> |
254 | </tree> |
255 | </field> |
256 | </record> |
257 | |
258 | <!-- Form view for functional block --> |
259 | <record model="ir.ui.view" id="funct_categ_form_view"> |
260 | - <field name="name">project.functional_block.form</field> |
261 | - <field name="model">project.functional_block</field> |
262 | + <field name="name">project.functional.block.form</field> |
263 | + <field name="model">project.functional.block</field> |
264 | <field name="type">form</field> |
265 | <field name="arch" type="xml"> |
266 | - <form string="Functional block"> |
267 | - <field name="name" select="1" /> |
268 | - <field name="parent_id"/> |
269 | - <separator colspan="4" string="Block description"/> |
270 | - <field name="category_description" colspan="4" nolabel="1" widget="text_wiki"/> |
271 | + <form string="Functional block" version="7.0"> |
272 | + <group> |
273 | + <field name="name"/> |
274 | + <field name="parent_id"/> |
275 | + </group> |
276 | + <separator string="Block description"/> |
277 | + <field name="description"/> |
278 | </form> |
279 | </field> |
280 | </record> |
281 | @@ -93,14 +96,14 @@ |
282 | <!-- OPEN BLOCK LIST --> |
283 | <record model="ir.actions.act_window" id="action_funct_block_list"> |
284 | <field name="name">Functional block list</field> |
285 | - <field name="res_model">project.functional_block</field> |
286 | + <field name="res_model">project.functional.block</field> |
287 | <field name="view_type">form</field> |
288 | <field name="view_mode">tree,form</field> |
289 | <field name="view_id" ref="funct_block_list_view"/> |
290 | <field name="search_view_id" ref="funct_block_search_view"/> |
291 | </record> |
292 | |
293 | - <menuitem name="Functional blocks" parent="project.menu_definitions" id="menu_functional_blocks"/> |
294 | + <menuitem name="Functional blocks" id="menu_functional_blocks" parent="base.menu_main_pm" sequence="50"/> |
295 | <menuitem name="Functional blocks" parent="menu_functional_blocks" id="menu_functional_blocks_list" action="action_funct_block_list" sequence="10"/> |
296 | |
297 | </data> |
298 | |
299 | === modified file 'project_functional_block/security/ir.model.access.csv' |
300 | --- __unported__/project_functional_blocks/security/ir.model.access.csv 2012-07-12 07:42:28 +0000 |
301 | +++ project_functional_block/security/ir.model.access.csv 2014-03-25 15:51:09 +0000 |
302 | @@ -1,3 +1,3 @@ |
303 | "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" |
304 | -"access_project_functional_block_manager","project.functional_block","model_project_functional_block","project.group_project_manager",1,1,1,1 |
305 | -"access_project_functional_block_user","project.functional_block","model_project_functional_block","project.group_project_user",1,0,0,0 |
306 | +"access_project_functional_block_manager","project.functional.block","model_project_functional_block","project.group_project_manager",1,1,1,1 |
307 | +"access_project_functional_block_user","project.functional.block","model_project_functional_block","project.group_project_user",1,0,0,0 |
308 | |
309 | === modified file 'project_issue_service/project_issue.py' |
310 | --- project_issue_service/project_issue.py 2013-01-03 11:34:54 +0000 |
311 | +++ project_issue_service/project_issue.py 2014-03-25 15:51:09 +0000 |
312 | @@ -28,7 +28,7 @@ |
313 | _inherit = 'project.issue' |
314 | _columns = { |
315 | #added fields: |
316 | - 'functional_block_id': fields.many2one('project.functional_block', 'Component', help = "Component (system, module, function) to be adressed"), |
317 | + 'functional_block_id': fields.many2one('project.functional.block', 'Component', help = "Component (system, module, function) to be adressed"), |
318 | 'assigned_to': fields.related('task_id', 'user_id', string = 'Task Assigned to', type="many2one", relation="res.users", store=True, help='This is the current user to whom the related task was assigned'), |
319 | 'tasks': fields.one2many('project.task', 'issue_id', 'Related tasks', help="Task history for the issue"), |
320 | 'create_uid': fields.many2one('res.users', 'Created by', help = "Person who reported the issue"), |
321 | |
322 | === modified file 'project_task_service/project_task.py' |
323 | --- project_task_service/project_task.py 2012-11-22 13:29:38 +0000 |
324 | +++ project_task_service/project_task.py 2014-03-25 15:51:09 +0000 |
325 | @@ -21,13 +21,14 @@ |
326 | from osv import fields, osv |
327 | from datetime import datetime, timedelta |
328 | |
329 | + |
330 | class task(osv.osv): |
331 | #FUTURE: use task recurrency, to generate maintenance plans |
332 | #FUTURE: Apply maintenance plan templates (use Project templates?) |
333 | _inherit = "project.task" |
334 | _columns = { |
335 | #modified fields: |
336 | - 'functional_block_id': fields.many2one('project.functional_block', 'Component', |
337 | + 'functional_block_id': fields.many2one('project.functional.block', 'Component', |
338 | help = "Component (system, module, function) to be addressed"), |
339 | #added fields: |
340 | 'ref': fields.char('Code', 20, help="Service Order number"), |
341 | @@ -54,8 +55,6 @@ |
342 | vals = {'date_start': task_dts, 'date_end': task_dte} |
343 | self.write(cr, uid, [t.id],vals, context=context) |
344 | return super(task, self).do_close(cr, uid, ids, context) |
345 | - |
346 | -task() |
347 | |
348 | |
349 | class project_work(osv.osv): |
350 | @@ -64,7 +63,6 @@ |
351 | _defaults = { |
352 | 'date': lambda *a: datetime.now().strftime('%Y-%m-%d'), |
353 | } |
354 | -project_work() |
355 | |
356 | |
357 | class project_task_type(osv.osv): |
358 | @@ -72,17 +70,10 @@ |
359 | _columns = { |
360 | 'code': fields.char('Code', size=10), |
361 | } |
362 | -project_task_type() |
363 | |
364 | |
365 | class project_functional_block(osv.osv): |
366 | - _inherit = 'project.functional_block' |
367 | + _inherit = 'project.functional.block' |
368 | _columns = { |
369 | 'code': fields.char('Code', size=10), |
370 | } |
371 | -project_functional_block() |
372 | - |
373 | - |
374 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
375 | - |
376 | - |
In L203, `colspan="4"`: I can be wrong, but I think in v7 this is ignored.
Otherwise, LGTM.