Merge lp:~gdgellatly/openobject-addons/6.1-pvm-fix-gdgellatly into lp:openobject-addons/extra-trunk

Proposed by Graeme Gellatly
Status: Approved
Approved by: Graeme Gellatly
Approved revision: no longer in the source branch.
Proposed branch: lp:~gdgellatly/openobject-addons/6.1-pvm-fix-gdgellatly
Merge into: lp:openobject-addons/extra-trunk
Diff against target: 21 lines (+12/-0)
1 file modified
product_variant_multi/product_variant.py (+12/-0)
To merge this branch: bzr merge lp:~gdgellatly/openobject-addons/6.1-pvm-fix-gdgellatly
Reviewer Review Type Date Requested Status
mrshelly Approve
Graeme Gellatly Approve
Review via email: mp+95715@code.launchpad.net

Commit message

fix for major bug in product_variant multi whereby when duplicating a product template, the copied dimension values duplicate their existing many2many relationships with their old product_ids.

Description of the change

Contains fix for major bug in product_variant multi whereby when duplicating a product template, the copied dimension values duplicate their existing many2many relationships with their old product_ids.

To post a comment you must log in.
Revision history for this message
Graeme Gellatly (gdgellatly) :
review: Approve
Revision history for this message
mrshelly (mrshelly) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'product_variant_multi/product_variant.py'
--- product_variant_multi/product_variant.py 2012-02-14 04:15:54 +0000
+++ product_variant_multi/product_variant.py 2012-03-03 01:49:19 +0000
@@ -93,6 +93,18 @@
93 raise osv.except_osv(_('Dimension value can not be removed'), _("The value %s is use in the product : %s \n Please remove this products before removing the value"%(value.option_id.name, product_list)))93 raise osv.except_osv(_('Dimension value can not be removed'), _("The value %s is use in the product : %s \n Please remove this products before removing the value"%(value.option_id.name, product_list)))
94 return super(product_variant_dimension_value, self).unlink(cr, uid, ids, context)94 return super(product_variant_dimension_value, self).unlink(cr, uid, ids, context)
9595
96 def copy(self, cr, uid, id, default=None, context=None):
97 if default is None:
98 default = {}
99 default['product_ids'] = False
100 return super(product_variant_dimension_value, self).copy(cr, uid, id, default, context=context)
101
102 def copy_data(self, cr, uid, id, default=None, context=None):
103 if default is None:
104 default = {}
105 default['product_ids'] = False
106 return super(product_variant_dimension_value, self).copy_data(cr, uid, id, default, context=context)
107
96 def _get_dimension_values(self, cr, uid, ids, context={}):108 def _get_dimension_values(self, cr, uid, ids, context={}):
97 return self.pool.get('product.variant.dimension.value').search(cr, uid, [('dimension_id', 'in', ids)], context=context)109 return self.pool.get('product.variant.dimension.value').search(cr, uid, [('dimension_id', 'in', ids)], context=context)
98110

Subscribers

People subscribed via source and target branches