Merge lp:~akretion-team/project-service/project-service-port-functionnal-block into lp:~project-core-editors/project-service/trunk

Proposed by Sébastien BEAU - http://www.akretion.com
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
Reviewer Review Type Date Requested Status
Daniel Reis lgtm Approve
Raphaël Valyi - http://www.akretion.com Approve
Review via email: mp+211984@code.launchpad.net

Description of the change

Port project functionnal block to 7 version.

To post a comment you must log in.
Revision history for this message
Daniel Reis (dreis-pt) wrote :

In L203, `colspan="4"`: I can be wrong, but I think in v7 this is ignored.
Otherwise, LGTM.

review: Approve
36. By Sébastien BEAU - http://www.akretion.com

[REF] port view on 7

Revision history for this message
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

Revision history for this message
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.functional_block" what is better keeping the "_" ou replacing it by a "."

Thanks

Revision history for this message
Daniel Reis (dreis-pt) wrote :

Good question.
I grepped the addons, and IMHO it would be more consistent to use "project.functional.block".

39. By Sébastien BEAU - http://www.akretion.com

[REF] rename project.functional_block into project.functional.block

Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Done ;)

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Thanks Seb, seems all right; tested.

review: Approve
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

Revision history for this message
Daniel Reis (dreis-pt) :
review: Approve (lgtm)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== renamed directory '__unported__/project_functional_blocks' => 'project_functional_block'
=== modified file 'project_functional_block/__init__.py'
--- __unported__/project_functional_blocks/__init__.py 2012-07-12 07:42:28 +0000
+++ project_functional_block/__init__.py 2014-03-25 15:51:09 +0000
@@ -3,7 +3,7 @@
3#3#
4# OpenERP, Open Source Management Solution4# OpenERP, Open Source Management Solution
5# Copyright (C) 2010 Akretion LDTA (<http://www.akretion.com>).5# Copyright (C) 2010 Akretion LDTA (<http://www.akretion.com>).
6# 6#
7#7#
8# This program is free software: you can redistribute it and/or modify8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as9# it under the terms of the GNU Affero General Public License as
@@ -20,6 +20,6 @@
20#20#
21##############################################################################21##############################################################################
2222
23import project23from . import project
2424
25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:25# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
2626
=== modified file 'project_functional_block/__openerp__.py' (properties changed: +x to -x)
--- __unported__/project_functional_blocks/__openerp__.py 2013-03-04 16:16:31 +0000
+++ project_functional_block/__openerp__.py 2014-03-25 15:51:09 +0000
@@ -18,22 +18,26 @@
18# along with this program. If not, see <http://www.gnu.org/licenses/>.18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#19#
20##############################################################################20##############################################################################
21{21
22 "name": "Project requiring functional blocks",22{'name': 'Project requiring functional blocks',
23 "version": "1.1dr",23 'version': '1.2',
24 "author": "Akretion",24 'author': 'Akretion',
25 "website": "http://www.openerp.com",25 'website': 'www.akretion.com',
26 "category": "project Management",26 'license': 'AGPL-3',
27 "depends": ["project"],27 'category': 'Generic Modules',
28 "description": """\28 'description': """
29Adds functional blocks to organize the projects tasks.29Adds functional blocks to organize the projects tasks.
30(fork from lp:~akretion-team/+junk/advanced-project-management)30 """,
31 """,31 'depends': [
32 "demo_xml": [],32 'project',
33 "update_xml": [33 ],
34 "security/ir.model.access.csv",34 'data': [
35 "project_view.xml",35 'security/ir.model.access.csv',
36 ],36 'project_view.xml',
37 'installable': False,37 ],
38 'demo': [
39 'project_demo.xml',
40 ],
41 'installable': True,
42 'application': True,
38}43}
39# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4044
=== modified file 'project_functional_block/project.py' (properties changed: +x to -x)
--- __unported__/project_functional_blocks/project.py 2012-11-22 13:15:34 +0000
+++ project_functional_block/project.py 2014-03-25 15:51:09 +0000
@@ -1,40 +1,67 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2from osv import fields, osv2##############################################################################
33#
4class project_functional_block(osv.osv):4# OpenERP, Open Source Management Solution
5 _name = 'project.functional_block'5# Copyright (C) 2010 Akretion LDTA (<http://www.akretion.com>).
6#
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23from openerp.osv import fields, orm
24
25
26class project_functional_block(orm.Model):
27 _name = 'project.functional.block'
6 _description = 'Functional block to organize projects tasks'28 _description = 'Functional block to organize projects tasks'
729
8 def name_get(self, cr, uid, ids, context=None):30 def name_get(self, cr, uid, ids, context=None):
9 res = []31 res = []
10 for row in self.read(cr, uid, ids, ['name','parent_id'], context=context):32 for row in self.read(cr, uid, ids, ['name', 'parent_id'], context=context):
11 parent = row['parent_id'] and (row['parent_id'][1]+' / ') or ''33 parent = row['parent_id'] and (row['parent_id'][1]+' / ') or ''
12 res.append((row['id'], parent + row['name']))34 res.append((row['id'], parent + row['name']))
13 return res35 return res
14 36
15 def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):37 def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
16 return dict( self.name_get(cr, uid, ids, context=context) )38 return dict(self.name_get(cr, uid, ids, context=context))
1739
18 _columns = {40 _columns = {
19 'name': fields.char('Name', size=64, required=True, translate=True),41 'name': fields.char('Name', size=64, required=True, translate=True),
42 'sequence': fields.integer('Sequence'),
20 'description': fields.text('Description', translate=True),43 'description': fields.text('Description', translate=True),
21 'parent_id': fields.many2one('project.functional_block', 'Parent block', select=True),44 'parent_id': fields.many2one(
22 'child_id': fields.one2many('project.functional_block', 'parent_id', 'Child block'),45 'project.functional.block',
23 'complete_name': fields.function(_name_get_fnc, method=True, type='char', string='Name'),46 'Parent block'),
47 'child_id': fields.one2many(
48 'project.functional.block',
49 'parent_id',
50 'Child block'),
51 'complete_name': fields.function(
52 _name_get_fnc,
53 method=True,
54 type='char',
55 string='Name'),
24 'code': fields.char('Code', size=10),56 'code': fields.char('Code', size=10),
25 }57 }
26 _order = 'parent_id,name'58 _order = 'parent_id, sequence, name'
2759
28 60
29project_functional_block()61class project_task(orm.Model):
30
31class project_task(osv.osv):
32 _inherit = 'project.task'62 _inherit = 'project.task'
33 _columns = {63 _columns = {
34 'functional_block_id': fields.many2one('project.functional_block', 'Functional Block'),64 'functional_block_id': fields.many2one(
65 'project.functional.block',
66 'Functional Block'),
35 }67 }
36 _constraints = [
37 (osv.osv._check_recursion, 'Error! Cannot create recursive cycle.', ['parent_id'])
38 ]
39
40project_task()
4168
=== added file 'project_functional_block/project_demo.xml'
--- project_functional_block/project_demo.xml 1970-01-01 00:00:00 +0000
+++ project_functional_block/project_demo.xml 2014-03-25 15:51:09 +0000
@@ -0,0 +1,21 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4
5 <record id="functional_block_1" model="project.functional.block">
6 <field name="name">WMS</field>
7 <field name="description">Warehouse Management System</field>
8 </record>
9
10 <record id="functional_block_2" model="project.functional.block">
11 <field name="name">CRM</field>
12 <field name="description">Customer Relationship Management</field>
13 </record>
14
15 <record id="functional_block_3" model="project.functional.block">
16 <field name="name">Accounting</field>
17 <field name="description">Accounting</field>
18 </record>
19
20 </data>
21</openerp>
022
=== modified file 'project_functional_block/project_view.xml'
--- __unported__/project_functional_blocks/project_view.xml 2012-07-12 07:42:28 +0000
+++ project_functional_block/project_view.xml 2014-03-25 15:51:09 +0000
@@ -7,8 +7,8 @@
7 <field name="type">form</field>7 <field name="type">form</field>
8 <field name="inherit_id" ref="project.view_task_form2"/>8 <field name="inherit_id" ref="project.view_task_form2"/>
9 <field name="arch" type="xml">9 <field name="arch" type="xml">
10 <xpath expr="/form/group/field[@name='progress']" position="after">10 <xpath expr="/form/sheet/group/group/field[@name='progress']" position="after">
11 <field name="functional_block_id" select="1"/>11 <field name="functional_block_id"/>
12 </xpath>12 </xpath>
13 </field>13 </field>
14 </record>14 </record>
@@ -20,7 +20,7 @@
20 <field name="inherit_id" ref="project.view_task_tree2"/>20 <field name="inherit_id" ref="project.view_task_tree2"/>
21 <field name="arch" type="xml">21 <field name="arch" type="xml">
22 <field name="user_id" position="after">22 <field name="user_id" position="after">
23 <field name="functional_block_id" select="1"/>23 <field name="functional_block_id"/>
24 </field>24 </field>
25 </field>25 </field>
26 </record>26 </record>
@@ -31,10 +31,10 @@
31 <field name="type">search</field>31 <field name="type">search</field>
32 <field name="inherit_id" ref="project.view_task_search_form"/>32 <field name="inherit_id" ref="project.view_task_search_form"/>
33 <field name="arch" type="xml">33 <field name="arch" type="xml">
34 <xpath expr="/search/group/field[@name='name']" position="after">34 <xpath expr="//field[@name='name']" position="after">
35 <field name="functional_block_id" select="1"/>35 <field name="functional_block_id" select="1"/>
36 </xpath>36 </xpath>
37 <xpath expr="/search/group[@string='Group By...']/filter[@string='Project']" position="after">37 <xpath expr="//filter[@string='Project']" position="after">
38 <separator orientation="vertical"/>38 <separator orientation="vertical"/>
39 <filter string="Functional Block" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'functional_block_id'}"/>39 <filter string="Functional Block" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'functional_block_id'}"/>
40 </xpath>40 </xpath>
@@ -44,8 +44,8 @@
44<!-- FUNCTIONAL BLOCK -->44<!-- FUNCTIONAL BLOCK -->
45 <!-- Search view for software module -->45 <!-- Search view for software module -->
46 <record id="funct_block_search_view" model="ir.ui.view">46 <record id="funct_block_search_view" model="ir.ui.view">
47 <field name="name">project.functional_block.search</field>47 <field name="name">project.functional.block.search</field>
48 <field name="model">project.functional_block</field>48 <field name="model">project.functional.block</field>
49 <field name="type">search</field>49 <field name="type">search</field>
50 <field name="arch" type="xml">50 <field name="arch" type="xml">
51 <search string="Search software's module"> 51 <search string="Search software's module">
@@ -64,28 +64,31 @@
64 64
65 <!-- tree view for functional block -->65 <!-- tree view for functional block -->
66 <record model="ir.ui.view" id="funct_block_list_view">66 <record model="ir.ui.view" id="funct_block_list_view">
67 <field name="name">project.functional_block.list</field>67 <field name="name">project.functional.block.list</field>
68 <field name="model">project.functional_block</field>68 <field name="model">project.functional.block</field>
69 <field name="type">tree</field>69 <field name="type">tree</field>
70 <field name="arch" type="xml">70 <field name="arch" type="xml">
71 <tree string="Functionality categories" > 71 <tree string="Functionality categories" >
72 <field name="name"/> 72 <field name="name"/>
73 <field name="parent_id"/> 73 <field name="parent_id"/>
74 <field name="sequence" invisible="True"/>
74 </tree>75 </tree>
75 </field> 76 </field>
76 </record>77 </record>
77 78
78 <!-- Form view for functional block -->79 <!-- Form view for functional block -->
79 <record model="ir.ui.view" id="funct_categ_form_view">80 <record model="ir.ui.view" id="funct_categ_form_view">
80 <field name="name">project.functional_block.form</field>81 <field name="name">project.functional.block.form</field>
81 <field name="model">project.functional_block</field>82 <field name="model">project.functional.block</field>
82 <field name="type">form</field>83 <field name="type">form</field>
83 <field name="arch" type="xml">84 <field name="arch" type="xml">
84 <form string="Functional block">85 <form string="Functional block" version="7.0">
85 <field name="name" select="1" />86 <group>
86 <field name="parent_id"/>87 <field name="name"/>
87 <separator colspan="4" string="Block description"/>88 <field name="parent_id"/>
88 <field name="category_description" colspan="4" nolabel="1" widget="text_wiki"/> 89 </group>
90 <separator string="Block description"/>
91 <field name="description"/>
89 </form>92 </form>
90 </field> 93 </field>
91 </record>94 </record>
@@ -93,14 +96,14 @@
93 <!-- OPEN BLOCK LIST --> 96 <!-- OPEN BLOCK LIST -->
94 <record model="ir.actions.act_window" id="action_funct_block_list">97 <record model="ir.actions.act_window" id="action_funct_block_list">
95 <field name="name">Functional block list</field>98 <field name="name">Functional block list</field>
96 <field name="res_model">project.functional_block</field>99 <field name="res_model">project.functional.block</field>
97 <field name="view_type">form</field> 100 <field name="view_type">form</field>
98 <field name="view_mode">tree,form</field> 101 <field name="view_mode">tree,form</field>
99 <field name="view_id" ref="funct_block_list_view"/>102 <field name="view_id" ref="funct_block_list_view"/>
100 <field name="search_view_id" ref="funct_block_search_view"/>103 <field name="search_view_id" ref="funct_block_search_view"/>
101 </record> 104 </record>
102105
103 <menuitem name="Functional blocks" parent="project.menu_definitions" id="menu_functional_blocks"/> 106 <menuitem name="Functional blocks" id="menu_functional_blocks" parent="base.menu_main_pm" sequence="50"/>
104 <menuitem name="Functional blocks" parent="menu_functional_blocks" id="menu_functional_blocks_list" action="action_funct_block_list" sequence="10"/> 107 <menuitem name="Functional blocks" parent="menu_functional_blocks" id="menu_functional_blocks_list" action="action_funct_block_list" sequence="10"/>
105 108
106 </data>109 </data>
107110
=== modified file 'project_functional_block/security/ir.model.access.csv'
--- __unported__/project_functional_blocks/security/ir.model.access.csv 2012-07-12 07:42:28 +0000
+++ project_functional_block/security/ir.model.access.csv 2014-03-25 15:51:09 +0000
@@ -1,3 +1,3 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2"access_project_functional_block_manager","project.functional_block","model_project_functional_block","project.group_project_manager",1,1,1,12"access_project_functional_block_manager","project.functional.block","model_project_functional_block","project.group_project_manager",1,1,1,1
3"access_project_functional_block_user","project.functional_block","model_project_functional_block","project.group_project_user",1,0,0,03"access_project_functional_block_user","project.functional.block","model_project_functional_block","project.group_project_user",1,0,0,0
44
=== modified file 'project_issue_service/project_issue.py'
--- project_issue_service/project_issue.py 2013-01-03 11:34:54 +0000
+++ project_issue_service/project_issue.py 2014-03-25 15:51:09 +0000
@@ -28,7 +28,7 @@
28 _inherit = 'project.issue'28 _inherit = 'project.issue'
29 _columns = {29 _columns = {
30 #added fields:30 #added fields:
31 'functional_block_id': fields.many2one('project.functional_block', 'Component', help = "Component (system, module, function) to be adressed"),31 'functional_block_id': fields.many2one('project.functional.block', 'Component', help = "Component (system, module, function) to be adressed"),
32 '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'),32 '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'),
33 'tasks': fields.one2many('project.task', 'issue_id', 'Related tasks', help="Task history for the issue"),33 'tasks': fields.one2many('project.task', 'issue_id', 'Related tasks', help="Task history for the issue"),
34 'create_uid': fields.many2one('res.users', 'Created by', help = "Person who reported the issue"),34 'create_uid': fields.many2one('res.users', 'Created by', help = "Person who reported the issue"),
3535
=== modified file 'project_task_service/project_task.py'
--- project_task_service/project_task.py 2012-11-22 13:29:38 +0000
+++ project_task_service/project_task.py 2014-03-25 15:51:09 +0000
@@ -21,13 +21,14 @@
21from osv import fields, osv21from osv import fields, osv
22from datetime import datetime, timedelta22from datetime import datetime, timedelta
2323
24
24class task(osv.osv):25class task(osv.osv):
25 #FUTURE: use task recurrency, to generate maintenance plans26 #FUTURE: use task recurrency, to generate maintenance plans
26 #FUTURE: Apply maintenance plan templates (use Project templates?)27 #FUTURE: Apply maintenance plan templates (use Project templates?)
27 _inherit = "project.task"28 _inherit = "project.task"
28 _columns = {29 _columns = {
29 #modified fields:30 #modified fields:
30 'functional_block_id': fields.many2one('project.functional_block', 'Component', 31 'functional_block_id': fields.many2one('project.functional.block', 'Component',
31 help = "Component (system, module, function) to be addressed"),32 help = "Component (system, module, function) to be addressed"),
32 #added fields:33 #added fields:
33 'ref': fields.char('Code', 20, help="Service Order number"),34 'ref': fields.char('Code', 20, help="Service Order number"),
@@ -54,8 +55,6 @@
54 vals = {'date_start': task_dts, 'date_end': task_dte}55 vals = {'date_start': task_dts, 'date_end': task_dte}
55 self.write(cr, uid, [t.id],vals, context=context)56 self.write(cr, uid, [t.id],vals, context=context)
56 return super(task, self).do_close(cr, uid, ids, context)57 return super(task, self).do_close(cr, uid, ids, context)
57
58task()
5958
6059
61class project_work(osv.osv):60class project_work(osv.osv):
@@ -64,7 +63,6 @@
64 _defaults = {63 _defaults = {
65 'date': lambda *a: datetime.now().strftime('%Y-%m-%d'),64 'date': lambda *a: datetime.now().strftime('%Y-%m-%d'),
66 }65 }
67project_work()
6866
6967
70class project_task_type(osv.osv):68class project_task_type(osv.osv):
@@ -72,17 +70,10 @@
72 _columns = {70 _columns = {
73 'code': fields.char('Code', size=10),71 'code': fields.char('Code', size=10),
74 }72 }
75project_task_type()
7673
7774
78class project_functional_block(osv.osv):75class project_functional_block(osv.osv):
79 _inherit = 'project.functional_block'76 _inherit = 'project.functional.block'
80 _columns = {77 _columns = {
81 'code': fields.char('Code', size=10),78 'code': fields.char('Code', size=10),
82 }79 }
83project_functional_block()
84
85
86# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
87
88

Subscribers

People subscribed via source and target branches