Merge lp:~openerp-dev/openobject-addons/6.0-opw-bom_name_translate_4563-ach into lp:openobject-addons/6.0

Proposed by Anup(SerpentCS)
Status: Merged
Merged at revision: 4489
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-bom_name_translate_4563-ach
Merge into: lp:openobject-addons/6.0
Diff against target: 14 lines (+4/-0)
1 file modified
mrp/mrp.py (+4/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-bom_name_translate_4563-ach
Reviewer Review Type Date Requested Status
Jay Vora (Serpent Consulting Services) (community) Needs Information
OpenERP buildbot (community) Approve
Review via email: mp+54171@code.launchpad.net

Description of the change

Hello,

     The Product's On Change does not work properly with different language due to missing context.
     Here is a solution that fixes the issue.

Thanks.

To post a comment you must log in.
Revision history for this message
OpenERP buildbot (openerp-buildbot) :
review: Approve
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Anup,

I fear we need to perform the same workaround for all such issues.
i.e. the code location where onchange method returns a translatable text.
Thanks.

review: Needs Information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp/mrp.py'
2--- mrp/mrp.py 2011-02-04 09:03:09 +0000
3+++ mrp/mrp.py 2011-03-21 09:26:06 +0000
4@@ -251,6 +251,10 @@
5 @param product_id: Changed product_id
6 @return: Dictionary of changed values
7 """
8+ if context is None:
9+ context = {}
10+ context['lang'] = self.pool.get('res.users').browse(cr,uid,uid).context_lang
11+
12 if product_id:
13 prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
14 v = {'product_uom': prod.uom_id.id}