← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~akretion-team/project-service/project-service-port-functionnal-block into lp:project-service

 

Sébastien BEAU - http://www.akretion.com has proposed merging lp:~akretion-team/project-service/project-service-port-functionnal-block into lp:project-service.

Requested reviews:
  Project Core Editors (project-core-editors)

For more details, see:
https://code.launchpad.net/~akretion-team/project-service/project-service-port-functionnal-block/+merge/211984

Port project functionnal block to 7 version.
-- 
https://code.launchpad.net/~akretion-team/project-service/project-service-port-functionnal-block/+merge/211984
Your team Project Core Editors is requested to review the proposed merge of lp:~akretion-team/project-service/project-service-port-functionnal-block into lp:project-service.
=== renamed directory '__unported__/project_functional_blocks' => 'project_functional_blocks'
=== modified file 'project_functional_blocks/__init__.py'
--- __unported__/project_functional_blocks/__init__.py	2012-07-12 07:42:28 +0000
+++ project_functional_blocks/__init__.py	2014-03-20 15:55:12 +0000
@@ -3,7 +3,7 @@
 #
 #    OpenERP, Open Source Management Solution
 #    Copyright (C) 2010 Akretion LDTA (<http://www.akretion.com>).
-#    
+#
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU Affero General Public License as
@@ -20,6 +20,6 @@
 #
 ##############################################################################
 
-import project
+from . import project
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'project_functional_blocks/__openerp__.py' (properties changed: +x to -x)
--- __unported__/project_functional_blocks/__openerp__.py	2013-03-04 16:16:31 +0000
+++ project_functional_blocks/__openerp__.py	2014-03-20 15:55:12 +0000
@@ -18,22 +18,23 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 ##############################################################################
-{
-    "name": "Project requiring functional blocks",
-    "version": "1.1dr",
-    "author": "Akretion",
-    "website": "http://www.openerp.com";,
-    "category": "project Management",
-    "depends": ["project"],
-    "description": """\
+
+{'name': 'Project requiring functional blocks',
+ 'version': '1.2',
+ 'author': 'Akretion',
+ 'website': 'www.akretion.com',
+ 'license': 'AGPL-3',
+ 'category': 'Generic Modules',
+ 'description': """
 Adds functional blocks to organize the projects tasks.
-(fork from lp:~akretion-team/+junk/advanced-project-management)
-    """,
-    "demo_xml": [],
-    "update_xml": [
-            "security/ir.model.access.csv",
-            "project_view.xml",
-            ],
-    'installable': False,
+ """,
+ 'depends': [
+     'project',
+ ],
+ 'data': [
+     'security/ir.model.access.csv',
+     'project_view.xml',
+ ],
+ 'installable': True,
+ 'application': True,
 }
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'project_functional_blocks/project.py' (properties changed: +x to -x)
--- __unported__/project_functional_blocks/project.py	2012-11-22 13:15:34 +0000
+++ project_functional_blocks/project.py	2014-03-20 15:55:12 +0000
@@ -1,40 +1,67 @@
 # -*- coding: utf-8 -*-
-from osv import fields, osv
-
-class project_functional_block(osv.osv):
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2010 Akretion LDTA (<http://www.akretion.com>).
+#
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import fields, orm
+
+
+class project_functional_block(orm.Model):
     _name = 'project.functional_block'
     _description = 'Functional block to organize projects tasks'
 
     def name_get(self, cr, uid, ids, context=None):
         res = []
-        for row in self.read(cr, uid, ids, ['name','parent_id'], context=context):
+        for row in self.read(cr, uid, ids, ['name', 'parent_id'], context=context):
             parent = row['parent_id'] and (row['parent_id'][1]+' / ') or ''
             res.append((row['id'], parent + row['name']))
         return res
-        
+
     def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None):
-        return dict( self.name_get(cr, uid, ids, context=context) )
+        return dict(self.name_get(cr, uid, ids, context=context))
 
     _columns = {
         'name': fields.char('Name', size=64, required=True, translate=True),
+        'sequence': fields.integer('Sequence'),
         'description': fields.text('Description', translate=True),
-        'parent_id': fields.many2one('project.functional_block', 'Parent block', select=True),
-        'child_id': fields.one2many('project.functional_block', 'parent_id', 'Child block'),
-        'complete_name': fields.function(_name_get_fnc, method=True, type='char', string='Name'),
+        'parent_id': fields.many2one(
+            'project.functional_block',
+            'Parent block'),
+        'child_id': fields.one2many(
+            'project.functional_block',
+            'parent_id',
+            'Child block'),
+        'complete_name': fields.function(
+            _name_get_fnc,
+            method=True,
+            type='char',
+            string='Name'),
         'code': fields.char('Code', size=10),
     }
-    _order = 'parent_id,name'
-
-    
-project_functional_block()
-
-class project_task(osv.osv):
+    _order = 'parent_id, sequence, name'
+
+
+class project_task(orm.Model):
     _inherit = 'project.task'
     _columns = {
-        'functional_block_id': fields.many2one('project.functional_block', 'Functional Block'),
+        'functional_block_id': fields.many2one(
+            'project.functional_block',
+            'Functional Block'),
     }
-    _constraints = [
-        (osv.osv._check_recursion, 'Error! Cannot create recursive cycle.', ['parent_id'])
-    ]
-    
-project_task()

=== modified file 'project_functional_blocks/project_view.xml'
--- __unported__/project_functional_blocks/project_view.xml	2012-07-12 07:42:28 +0000
+++ project_functional_blocks/project_view.xml	2014-03-20 15:55:12 +0000
@@ -7,7 +7,7 @@
             <field name="type">form</field>
             <field name="inherit_id" ref="project.view_task_form2"/>
             <field name="arch" type="xml">
-                <xpath expr="/form/group/field[@name='progress']" position="after">
+                <xpath expr="/form/sheet/group/group/field[@name='progress']" position="after">
                     <field name="functional_block_id" select="1"/>
                 </xpath>
             </field>
@@ -31,10 +31,10 @@
             <field name="type">search</field>
             <field name="inherit_id" ref="project.view_task_search_form"/>
             <field name="arch" type="xml">
-                <xpath expr="/search/group/field[@name='name']" position="after">
+                <xpath expr="//field[@name='name']" position="after">
                     <field name="functional_block_id" select="1"/>
                 </xpath>
-                <xpath expr="/search/group[@string='Group By...']/filter[@string='Project']" position="after">
+                <xpath expr="//filter[@string='Project']" position="after">
                 	<separator orientation="vertical"/>
                     <filter string="Functional Block" icon="terp-gtk-jump-to-ltr" domain="[]" context="{'group_by':'functional_block_id'}"/>
                 </xpath>
@@ -69,8 +69,9 @@
 			<field name="type">tree</field>
 			<field name="arch" type="xml">
 			   <tree string="Functionality categories" >				
-					<field name="name"/>	
-					<field name="parent_id"/>				
+					<field name="name"/>
+					<field name="parent_id"/>
+                    <field name="sequence" invisible="True"/>
 			   </tree>
 			</field>			   
 		</record>
@@ -85,7 +86,7 @@
 					<field name="name" select="1" />
 					<field name="parent_id"/>
 					<separator colspan="4" string="Block description"/>
-					<field name="category_description" colspan="4" nolabel="1" widget="text_wiki"/>	
+					<field name="description" colspan="4" nolabel="1" />	
 			   </form>
 			</field>			   
 		</record>
@@ -100,7 +101,7 @@
 			<field name="search_view_id" ref="funct_block_search_view"/>
 		</record> 
 
-	<menuitem name="Functional blocks" parent="project.menu_definitions" id="menu_functional_blocks"/>		
+	<menuitem name="Functional blocks" id="menu_functional_blocks" parent="base.menu_main_pm" sequence="50"/>		
 	<menuitem name="Functional blocks" parent="menu_functional_blocks" id="menu_functional_blocks_list" action="action_funct_block_list" sequence="10"/> 				
 		
     </data>