Merge lp:~dorian-kemps/unifield-server/US-12147 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 6284
Proposed branch: lp:~dorian-kemps/unifield-server/US-12147
Merge into: lp:unifield-server
Diff against target: 30 lines (+8/-0)
2 files modified
bin/addons/base/ir/ir_model.py (+4/-0)
bin/addons/product_attributes/product_attributes.py (+4/-0)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-12147
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+465681@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 'bin/addons/base/ir/ir_model.py'
2--- bin/addons/base/ir/ir_model.py 2023-08-11 14:03:59 +0000
3+++ bin/addons/base/ir/ir_model.py 2024-05-07 10:17:43 +0000
4@@ -861,7 +861,11 @@
5 and not context.get('is_inkind_donation')
6 if is_debit_note and values.get('invoice_line'):
7 raise osv.except_osv(_('Error'), _('Creating Debit Note lines by file import is not allowed.'))
8+ if model == 'product.product' and xml_id:
9+ context['product_sdref'] = xml_id
10 res_id = model_obj.create(cr, uid, values, context=context)
11+ if context.get('product_sdref'):
12+ context.pop('product_sdref')
13 # US-180: Only create ir model data if res_id is valid
14 if xml_id and res_id:
15 if context.get('sync_update_execution') and model == 'res.partner' and module == 'sd':
16
17=== modified file 'bin/addons/product_attributes/product_attributes.py'
18--- bin/addons/product_attributes/product_attributes.py 2024-05-02 09:35:15 +0000
19+++ bin/addons/product_attributes/product_attributes.py 2024-05-07 10:17:43 +0000
20@@ -1722,6 +1722,10 @@
21 for prd_data in data_obj.browse(cr, uid, prd_data_ids, context=context):
22 update_existing_translations('product.product', res, prd_data.name)
23 update_existing_translations('product.template', product_tmpl_id, prd_data.name)
24+ # US-12147: Update existing translations before the ir_model_data for the product has been fully created
25+ if not prd_data_ids and context.get('product_sdref'):
26+ update_existing_translations('product.product', res, context['product_sdref'])
27+ update_existing_translations('product.template', product_tmpl_id, context['product_sdref'])
28
29 sptc_obj.track_change(cr, uid, res, _('Product creation'), vals,
30 context=context)

Subscribers

People subscribed via source and target branches