summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2015-11-18 09:24:17 +0100
committerRaphael Collet <rco@openerp.com>2015-11-27 14:55:49 +0100
commit5da3a758fc33dcbca17de1a38a3bebf578b58f8d (patch)
tree541a353f6192e6e6dd9975b41e7b69f3d00b0112
parent2a1d6f7641c1f8f475629c2b43e6da378b78261b (diff)
[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...
-rw-r--r--addons/base_action_rule/base_action_rule.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index 7d229ce5bca..3201d9b9381 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -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)