[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:
Raphael Collet
2015-11-27 14:55:49 +01:00
parent 2a1d6f7641
commit 5da3a758fc
+1 -1
View File
@@ -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)