← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~yann-papouin/ocb-server/6.1-bug-1247158-propagate-context into lp:ocb-server/6.1

 

Yann Papouin has proposed merging lp:~yann-papouin/ocb-server/6.1-bug-1247158-propagate-context into lp:ocb-server/6.1.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1247158 in OpenERP Community Backports (Server): "[6.1,7.0,trunk] Context is not propagated when writing translation on 'source' fields "
  https://bugs.launchpad.net/ocb-server/+bug/1247158

For more details, see:
https://code.launchpad.net/~yann-papouin/ocb-server/6.1-bug-1247158-propagate-context/+merge/204271

Backport from 7.0
-- 
https://code.launchpad.net/~yann-papouin/ocb-server/6.1-bug-1247158-propagate-context/+merge/204271
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~yann-papouin/ocb-server/6.1-bug-1247158-propagate-context into lp:ocb-server/6.1.
=== modified file 'openerp/osv/orm.py'
--- openerp/osv/orm.py	2013-10-08 13:16:15 +0000
+++ openerp/osv/orm.py	2014-01-31 15:53:13 +0000
@@ -3943,7 +3943,8 @@
                         if not src_trans:
                             src_trans = vals[f]
                             # Inserting value to DB
-                            self.write(cr, user, ids, {f: vals[f]})
+                            context_wo_lang = dict(context, lang=None)
+                            self.write(cr, user, ids, {f: vals[f]}, context=context_wo_lang)
                         self.pool.get('ir.translation')._set_ids(cr, user, self._name+','+f, 'model', context['lang'], ids, vals[f], src_trans)
 
 


Follow ups