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
This commit is contained in:
Cédric Krier
2026-01-10 18:39:18 +01:00
parent e8a3027434
commit 4d8cfec64b
@@ -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])