[FIX] Model.create: trigger stored field recalculation for implicit parent_id fields during create
The create() method implicitly creates parent records on objects of the _inherits. Therefore, in order to make the trigger on the linked field works, we should include all the _inherits values (fields that make the link to the parent record) because they are created implicitly. The write() method does not need this change, as any update of the parent fields has to be explicit. bzr revid: odo@openerp.com-20131209184718-wczdefzo9evc0cgc
This commit is contained in:
commit
86776035ba
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue