From 4d8cfec64ba3e3892fd0736eb0f3d58642c1b116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 10 Jan 2026 18:39:18 +0100 Subject: [PATCH] Test the record reference of marketing automation record before execution The reference field is on the record and not on the record activity. Closes #14281 (grafted from a7bcd29273f4b7cc5d4d8ce8c1a5f86242ece361) --HG-- branch : 6.0 --- modules/marketing_automation/marketing_automation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/marketing_automation/marketing_automation.py b/modules/marketing_automation/marketing_automation.py index 43a4fd240c..ef99bb2894 100644 --- a/modules/marketing_automation/marketing_automation.py +++ b/modules/marketing_automation/marketing_automation.py @@ -484,13 +484,13 @@ class Activity(ModelSQL, ModelView): activity=self.rec_name, exception=exception)) from exception - def execute(self, activity, **kwargs): + def execute(self, record_activity, **kwargs): pool = Pool() RecordActivity = pool.get('marketing.automation.record.activity') - record = activity.record + record = record_activity.record # As it is a reference, the record may have been deleted - if not record: + if not record.record: return # XXX: use domain @@ -498,7 +498,7 @@ class Activity(ModelSQL, ModelView): return if self.action: - getattr(self, 'execute_' + self.action)(activity, **kwargs) + getattr(self, 'execute_' + self.action)(record_activity, **kwargs) RecordActivity.save([ RecordActivity.get(record, child) for child in self.children])