Merge lp:~unifield-team/unifield-wm/us-730 into lp:unifield-wm

Proposed by jftempo
Status: Merged
Merged at revision: 2691
Proposed branch: lp:~unifield-team/unifield-wm/us-730
Merge into: lp:unifield-wm
Diff against target: 21 lines (+11/-0)
1 file modified
product_nomenclature/product_nomenclature.py (+11/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/us-730
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+278804@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product_nomenclature/product_nomenclature.py'
2--- product_nomenclature/product_nomenclature.py 2015-11-09 14:18:11 +0000
3+++ product_nomenclature/product_nomenclature.py 2015-11-27 13:20:37 +0000
4@@ -755,6 +755,17 @@
5 def get_sub_nomen(self, cr, uid, id, field):
6 return self.pool.get('product.nomenclature').get_sub_nomen(cr, uid, self, id, field)
7
8+ def copy(self, cr, uid, old_id, new_vals=None, context=None):
9+ res = super(product_product, self).copy(cr, uid, old_id, new_vals, context=context)
10+ if new_vals.get('default_code', None) == 'XXX':
11+ # Delete the translations linked to this new product
12+ tr_obj = self.pool.get('ir.translation')
13+ tr_ids = tr_obj.search(cr, uid, [('xml_id', '=', 'product_XXX')], context=context)
14+ if tr_ids:
15+ tr_obj.unlink(cr, uid, tr_ids, context=context)
16+
17+ return res
18+
19 def create(self, cr, uid, vals, context=None):
20 '''
21 override to complete nomenclature_description

Subscribers

People subscribed via source and target branches