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
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py 2011-02-04 09:03:09 +0000
+++ mrp/mrp.py 2011-03-21 09:26:06 +0000
@@ -251,6 +251,10 @@
251 @param product_id: Changed product_id251 @param product_id: Changed product_id
252 @return: Dictionary of changed values252 @return: Dictionary of changed values
253 """253 """
254 if context is None:
255 context = {}
256 context['lang'] = self.pool.get('res.users').browse(cr,uid,uid).context_lang
257
254 if product_id:258 if product_id:
255 prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)259 prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
256 v = {'product_uom': prod.uom_id.id}260 v = {'product_uom': prod.uom_id.id}