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
1=== modified file 'product_variant_multi/product_variant.py'
2--- product_variant_multi/product_variant.py 2012-02-14 04:15:54 +0000
3+++ product_variant_multi/product_variant.py 2012-03-03 01:49:19 +0000
4@@ -93,6 +93,18 @@
5 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)))
6 return super(product_variant_dimension_value, self).unlink(cr, uid, ids, context)
7
8+ def copy(self, cr, uid, id, default=None, context=None):
9+ if default is None:
10+ default = {}
11+ default['product_ids'] = False
12+ return super(product_variant_dimension_value, self).copy(cr, uid, id, default, context=context)
13+
14+ def copy_data(self, cr, uid, id, default=None, context=None):
15+ if default is None:
16+ default = {}
17+ default['product_ids'] = False
18+ return super(product_variant_dimension_value, self).copy_data(cr, uid, id, default, context=context)
19+
20 def _get_dimension_values(self, cr, uid, ids, context={}):
21 return self.pool.get('product.variant.dimension.value').search(cr, uid, [('dimension_id', 'in', ids)], context=context)
22

Subscribers

People subscribed via source and target branches