[FIX] Trigger stored field recalculation for inherited records

The create() method implicitly creates record on objects of the _inherits.
Therefore, in order to make the trigger on linked field works, we should
include all the _inherits values (field that makes the link to the rel
record) because they are created implicitly.

bzr revid: cto@openerp.com-20131209154857-788f94w0kh6ef5pp
This commit is contained in:
Cecile Tonglet 2013-12-09 16:48:57 +01:00
parent 9652fb0013
commit 3b328aaab4
1 changed files with 3 additions and 1 deletions

View File

@ -4487,7 +4487,9 @@ class BaseModel(object):
self._validate(cr, user, [id_new], context)
if not context.get('no_store_function', False):
result += self._store_get_values(cr, user, [id_new], vals.keys(), context)
result += self._store_get_values(cr, user, [id_new],
list(set(vals.keys() + self._inherits.values())),
context)
result.sort()
done = []
for order, object, ids, fields2 in result: