[FIX] propage the context to not lose special keys/values on write() and explicit...
authorGuewen Baconnier <guewen.baconnier@camptocamp.com>
Fri, 1 Nov 2013 16:18:20 +0000 (17:18 +0100)
committerGuewen Baconnier <guewen.baconnier@camptocamp.com>
Fri, 1 Nov 2013 16:18:20 +0000 (17:18 +0100)
lp bug: https://launchpad.net/bugs/1247158 fixed

bzr revid: guewen.baconnier@camptocamp.com-20131101161820-rwzh8zx2nqpb7r2q

openerp/osv/orm.py

index 3ec2f69..5332d18 100644 (file)
@@ -4168,7 +4168,9 @@ class BaseModel(object):
                         if not src_trans:
                             src_trans = vals[f]
                             # Inserting value to DB
-                            self.write(cr, user, ids, {f: vals[f]})
+                            ctx = context.copy()
+                            ctx['lang'] = 'en_US'
+                            self.write(cr, user, ids, {f: vals[f]}, context=ctx)
                         self.pool.get('ir.translation')._set_ids(cr, user, self._name+','+f, 'model', context['lang'], ids, vals[f], src_trans)