summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoisés López <moylop260@vauxoo.com>2020-04-30 15:13:33 +0000
committerMartin Trigaux <mat@odoo.com>2020-05-11 06:03:54 +0000
commit10592f472ca96bb1c137d25ccd82cc449c81dbb7 (patch)
tree31a665c08e08e2cc0fd9e616cdcd92b12f7f0eec
parentd5100fc0626e9e843bbb2125c04dca2844f9c43f (diff)
[IMP] base_automation: log time-based automated action starts and ends
If there is cron worker timeout logger error, there is a log for the last cron running If a "Base Action Rule: check and execute" fails, we need to know what is the last base automated action based on-time running This logger helps to looked for it closes odoo/odoo#50493 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
-rw-r--r--addons/base_automation/models/base_automation.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/base_automation/models/base_automation.py b/addons/base_automation/models/base_automation.py
index 5051ed9f60d..0d1e5604f88 100644
--- a/addons/base_automation/models/base_automation.py
+++ b/addons/base_automation/models/base_automation.py
@@ -474,6 +474,7 @@ class BaseAutomation(models.Model):
# retrieve all the action rules to run based on a timed condition
eval_context = self._get_eval_context()
for action in self.with_context(active_test=True).search([('trigger', '=', 'on_time')]):
+ _logger.info("Starting time-based automated action `%s`.", action.name)
last_run = fields.Datetime.from_string(action.last_run) or datetime.datetime.utcfromtimestamp(0)
# retrieve all the records that satisfy the action's condition
@@ -503,6 +504,7 @@ class BaseAutomation(models.Model):
_logger.error(traceback.format_exc())
action.write({'last_run': now.strftime(DEFAULT_SERVER_DATETIME_FORMAT)})
+ _logger.info("Time-based automated action `%s` done.", action.name)
if automatic:
# auto-commit for batch processing