[IMP] base_action_rule: add old_values=None in context of actions done on create
In particular, when an automated action is defined on "create or update", setting `old_values` to `None` allows to distinguish between a create and an update. Note that not setting `old_values` at all may be confusing: on a create, it may be present because of an outer update...
This commit is contained in:
@@ -226,7 +226,7 @@ class base_action_rule(osv.osv):
|
||||
record = create.origin(self.with_env(actions.env), vals)
|
||||
|
||||
# check postconditions, and execute actions on the records that satisfy them
|
||||
for action in actions:
|
||||
for action in actions.with_context(old_values=None):
|
||||
action._process(action._filter_post(record))
|
||||
|
||||
return record.with_env(self.env)
|
||||
|
||||
Reference in New Issue
Block a user