← Back to team overview

openerp-community team mailing list archive

lp:~camptocamp/openerp-product-attributes/7.0-product_m2mcategories-migr into lp:openerp-product-attributes

 

Guewen Baconnier @ Camptocamp has proposed merging lp:~camptocamp/openerp-product-attributes/7.0-product_m2mcategories-migr into lp:openerp-product-attributes.

Requested reviews:
  Product Core Editors (product-core-editors)

For more details, see:
https://code.launchpad.net/~camptocamp/openerp-product-attributes/7.0-product_m2mcategories-migr/+merge/145601

Migration of the module product_m2mcategories

 * Missing coding in python modules
 * remove useless node and attribute in the view
 * updated the __openerp__ manifest with reSt formatting and some changes (use 'data' key, change the category, ...)
 * changed the help messages on the fields
 * filter the categories on [('type', '=', 'normal')] (I became aware of the 'view' type of the product categories).
-- 
https://code.launchpad.net/~camptocamp/openerp-product-attributes/7.0-product_m2mcategories-migr/+merge/145601
Your team OpenERP Community is subscribed to branch lp:openerp-product-attributes.
=== modified file 'product_m2mcategories/__init__.py'
--- product_m2mcategories/__init__.py	2009-08-16 04:28:55 +0000
+++ product_m2mcategories/__init__.py	2013-01-30 13:26:22 +0000
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 #########################################################################
 # Copyright (C) 2009  Sharoon Thomas & Open ERP Community               #
 #                                                                       #
@@ -15,4 +16,4 @@
 #along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
 #########################################################################
 
-import product
\ No newline at end of file
+import product

=== modified file 'product_m2mcategories/__openerp__.py'
--- product_m2mcategories/__openerp__.py	2013-01-21 06:49:06 +0000
+++ product_m2mcategories/__openerp__.py	2013-01-30 13:26:22 +0000
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 #########################################################################
 # Copyright (C) 2009  Sharoon Thomas  & Open ERP Community              #
 #                                                                       #
@@ -17,23 +18,21 @@
 
 {
     "name" : "Product - Many Categories",
-    "version" : "6.1.0",
+    "version" : "7.0.0",
     "author" : "Sharoon Thomas",
     "website" : "",
-    "category" : "Added functionality",
-    "depends" : ['base','product'],
+    "category" : "Generic Modules",
+    "depends" : ['product'],
     "description": """
-    This module extends the existing functionality of OpenERP Products (One product -> One Category)
-    to One product -> Many Categories
+This module extends the existing functionality of OpenERP Products (One
+product -> One Category) to One product -> Many Categories
 
-    *Note: This module was built generically but in focus of the Magento OpenERP connector
-    """,
-    "init_xml": [],
-    "update_xml": [
+.. note:: This module was built generically but in focus of the Magento
+          OpenERP connector """,
+    "data": [
             'product_view.xml'
     ],
-    'installable': False,
+    'installable': True,
     "active": False,
 }
-
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'product_m2mcategories/product.py'
--- product_m2mcategories/product.py	2012-08-21 14:10:21 +0000
+++ product_m2mcategories/product.py	2013-01-30 13:26:22 +0000
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 #########################################################################
 # Copyright (C) 2009  Sharoon Thomas & Open ERP Community               #
 #                                                                       #
@@ -14,12 +15,29 @@
 #You should have received a copy of the GNU General Public License      #
 #along with this program.  If not, see <http://www.gnu.org/licenses/>.  #
 #########################################################################
-from openerp.osv.orm import Model
-from openerp.osv import fields
-
-class product_product(Model):
+
+from openerp.osv import orm, fields
+
+
+class product_product(orm.Model):
+
     _inherit = "product.template"
+
     _columns = {
-        'categ_id': fields.many2one('product.category','Pricing/Primary Category', required=True, change_default=True),
-        'categ_ids': fields.many2many('product.category','product_categ_rel','product_id','categ_id','Product Categories')
+        'categ_id': fields.many2one('product.category',
+                                    'Pricing/Primary Category',
+                                    required=True,
+                                    change_default=True,
+                                    domain="[('type', '=', 'normal')]",
+                                    help="Select category for the current "
+                                         "product. The accounting and stock "
+                                         "properties come from this category."),
+        'categ_ids': fields.many2many('product.category',
+                                      'product_categ_rel',
+                                      'product_id',
+                                      'categ_id',
+                                      string='Product Categories',
+                                      domain="[('type', '=', 'normal')]",
+                                      help="Select additional categories "
+                                           "for the current product")
         }

=== modified file 'product_m2mcategories/product_view.xml'
--- product_m2mcategories/product_view.xml	2012-12-23 01:32:22 +0000
+++ product_m2mcategories/product_view.xml	2013-01-30 13:26:22 +0000
@@ -5,10 +5,9 @@
             <field name="name">product.normal.form</field>
             <field name="model">product.product</field>
             <field name="inherit_id" ref="product.product_normal_form_view" />
-            <field name="type">form</field>
             <field eval="7" name="priority"/>
             <field name="arch" type="xml">
-                <page string="Information" position="after" version="7.0">
+                <page string="Information" position="after">
                     <page string="Extra Categories">
                         <separator string="Classification Categories" colspan="2"/>
                         <newline/>


Follow ups