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

Proposed by Raphaël Valyi - http://www.akretion.com
Status: Merged
Merged at revision: 204
Proposed branch: lp:~akretion-team/openerp-product-attributes/dont-blow-if-same-field-twice
Merge into: lp:~product-core-editors/openerp-product-attributes/7.0
Prerequisite: lp:~akretion-team/openerp-product-attributes/optional_attr_set
Diff against target: 15 lines (+3/-2)
1 file modified
product_custom_attributes/product.py (+3/-2)
To merge this branch: bzr merge lp:~akretion-team/openerp-product-attributes/dont-blow-if-same-field-twice
Reviewer Review Type Date Requested Status
Niels Huylebroeck (community) Approve
Guewen Baconnier @ Camptocamp Approve
Review via email: mp+148606@code.launchpad.net

Description of the change

[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

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Seems fine to me

review: Approve
Revision history for this message
Niels Huylebroeck (red15) wrote :

Looks sensible, just not sure why it's showing 3 revisions unmerged but the preview diff is only showing change from the last rev?

review: Approve
Revision history for this message
Numérigraphe (numerigraphe) wrote :

Dear Niels Huylebroeck,
The prerequisite branch specified in this proposal has the first two unmerged revisions.
Lionel Sausin.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product_custom_attributes/product.py'
2--- product_custom_attributes/product.py 2013-02-15 04:39:23 +0000
3+++ product_custom_attributes/product.py 2013-02-15 04:39:23 +0000
4@@ -110,8 +110,9 @@
5 for group in grp_obj.browse(cr, uid, attribute_group_ids, context=context):
6 page = etree.SubElement(notebook, 'page', string=group.name.capitalize())
7 for attribute in group.attribute_ids:
8- toupdate_fields.append(attribute.name)
9- self._build_attribute_field(cr, uid, page, attribute, context=context)
10+ if attribute.name not in toupdate_fields:
11+ toupdate_fields.append(attribute.name)
12+ self._build_attribute_field(cr, uid, page, attribute, context=context)
13 return notebook, toupdate_fields
14
15 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):

Subscribers

People subscribed via source and target branches