[FIX] propage the context to not lose special keys/values on write() and explicit the source language to write to (en_US)

lp bug: https://launchpad.net/bugs/1247158 fixed

bzr revid: guewen.baconnier@camptocamp.com-20131101161820-rwzh8zx2nqpb7r2q
This commit is contained in:
Guewen Baconnier 2013-11-01 17:18:20 +01:00
parent e3c98d3b5b
commit 226ed9abea
1 changed files with 3 additions and 1 deletions

View 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)