From 5ccfeaaeda425a3efe7311bab447e8bdfd36d56e Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 11 Jun 2014 11:52:29 +0200 Subject: [PATCH] [FIX] base_action_rule: automatic commit during background processing of rules This will make sure already processed rules are persisted in case a timeout occurs while processing the next ones, ensuring that *some* progress can be made in most cases. --- addons/base_action_rule/base_action_rule.py | 4 ++++ addons/base_action_rule/base_action_rule_data.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index a6793e9bac5..1b80f9f36c3 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -280,3 +280,7 @@ class base_action_rule(osv.osv): _logger.error(traceback.format_exc()) action.write({'last_run': now.strftime(DEFAULT_SERVER_DATETIME_FORMAT)}) + + if automatic: + # auto-commit for batch processing + cr.commit() diff --git a/addons/base_action_rule/base_action_rule_data.xml b/addons/base_action_rule/base_action_rule_data.xml index 7a9aabedf5f..d4b12f5d4a3 100644 --- a/addons/base_action_rule/base_action_rule_data.xml +++ b/addons/base_action_rule/base_action_rule_data.xml @@ -10,7 +10,7 @@ - +