← Back to team overview

openerp-community team mailing list archive

lp:~akretion-team/openerp-product-attributes/dont-blow-if-same-field-twice into lp:openerp-product-attributes

 

Raphaël Valyi - http://www.akretion.com has proposed merging lp:~akretion-team/openerp-product-attributes/dont-blow-if-same-field-twice into lp:openerp-product-attributes with lp:~akretion-team/openerp-product-attributes/optional_attr_set as a prerequisite.

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

For more details, see:
https://code.launchpad.net/~akretion-team/openerp-product-attributes/dont-blow-if-same-field-twice/+merge/148606

[FIX][product_custom_attributes] 2 attr groups can include the same field. In such case, present the field in the first group where it's found only instead of twice which leads to bugs
-- 
https://code.launchpad.net/~akretion-team/openerp-product-attributes/dont-blow-if-same-field-twice/+merge/148606
Your team OpenERP Community is subscribed to branch lp:openerp-product-attributes.
=== modified file 'product_custom_attributes/product.py'
--- product_custom_attributes/product.py	2013-02-15 04:39:23 +0000
+++ product_custom_attributes/product.py	2013-02-15 04:39:23 +0000
@@ -110,8 +110,9 @@
         for group in grp_obj.browse(cr, uid, attribute_group_ids, context=context):
             page = etree.SubElement(notebook, 'page', string=group.name.capitalize())
             for attribute in group.attribute_ids:
-                toupdate_fields.append(attribute.name)
-                self._build_attribute_field(cr, uid, page, attribute, context=context)
+                if attribute.name not in toupdate_fields:
+                    toupdate_fields.append(attribute.name)
+                    self._build_attribute_field(cr, uid, page, attribute, context=context)
         return notebook, toupdate_fields
 
     def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):


Follow ups