From 440e892ed71eac9a7b8e33f83ae58d2761200f68 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 16 Nov 2020 15:55:09 +0000 Subject: [PATCH] [FIX] base_automation: traceback on updates Steps to reproduce the bug: 1.Create an automated action with the following: - Model: Task (project.task) - Active: True - Trigger: On Update - Action To Do: Create Next Activity 2. Open or create a task in Project module 3. Edit 4. Change or set customer (partner_id) Bug: An error message was raised. opw:2376492 closes odoo/odoo#61812 X-original-commit: b3415d9dd0bcc1053e47b8a0082c772ca4a8220f Related: odoo/enterprise#14772 Signed-off-by: Simon Goffin (sig) Signed-off-by: Raphael Collet (rco) --- addons/base_automation/models/base_automation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_automation/models/base_automation.py b/addons/base_automation/models/base_automation.py index be72b5ac41d..2fd82b39388 100644 --- a/addons/base_automation/models/base_automation.py +++ b/addons/base_automation/models/base_automation.py @@ -322,7 +322,7 @@ class BaseAutomation(models.Model): actions = self.env['base.automation']._get_actions(self, ['on_write', 'on_create_or_write']) if not (actions and self): return write.origin(self, vals, **kw) - records = self.with_env(actions.env) + records = self.with_env(actions.env).filtered('id') # check preconditions on records pre = {action: action._filter_pre(records) for action in actions} # read old values before the update