diff --git a/__init__.py b/__init__.py
index 096a8b199d..6aa43f28e3 100644
--- a/__init__.py
+++ b/__init__.py
@@ -3,6 +3,7 @@
from trytond.pool import Pool
+from . import ir
from . import marketing_automation
from . import web
from . import party
@@ -14,6 +15,7 @@ __all__ = ['register', 'routes']
def register():
Pool.register(
+ ir.Cron,
marketing_automation.Scenario,
marketing_automation.Activity,
marketing_automation.Record,
diff --git a/ir.py b/ir.py
new file mode 100644
index 0000000000..ecb9014da2
--- /dev/null
+++ b/ir.py
@@ -0,0 +1,17 @@
+# This file is part of Tryton. The COPYRIGHT file at the top level of
+# this repository contains the full copyright notices and license terms.
+from trytond.pool import PoolMeta
+
+
+class Cron(metaclass=PoolMeta):
+ __name__ = 'ir.cron'
+
+ @classmethod
+ def __setup__(cls):
+ super().__setup__()
+ cls.method.selection.extend([
+ ('marketing.automation.scenario|trigger',
+ "Trigger Marketing Scenarios"),
+ ('marketing.automation.record.activity|process',
+ "Process Marketing Activity"),
+ ])
diff --git a/marketing_automation.xml b/marketing_automation.xml
index b0b2ae0731..236dadc237 100644
--- a/marketing_automation.xml
+++ b/marketing_automation.xml
@@ -299,39 +299,15 @@ this repository contains the full copyright notices and license terms. -->
html
-
- user_marketing_automation
- Cron Marketing Automation
-
-
-
-
-
-
-
- Trigger Scenarios
-
-
-
+ marketing.automation.scenario|trigger
hours
-
-
- marketing.automation.scenario
- trigger
- Process Record Activity
-
-
-
+ marketing.automation.record.activity|process
minutes
-
-
- marketing.automation.record.activity
- process
diff --git a/tests/scenario_marketing_automation.rst b/tests/scenario_marketing_automation.rst
index ce3a89a074..d4de514500 100644
--- a/tests/scenario_marketing_automation.rst
+++ b/tests/scenario_marketing_automation.rst
@@ -87,12 +87,10 @@ Trigger scenario::
>>> Cron = Model.get('ir.cron')
>>> cron_trigger, = Cron.find([
- ... ('model', '=', 'marketing.automation.scenario'),
- ... ('function', '=', 'trigger'),
+ ... ('method', '=', 'marketing.automation.scenario|trigger'),
... ])
>>> cron_process, = Cron.find([
- ... ('model', '=', 'marketing.automation.record.activity'),
- ... ('function', '=', 'process'),
+ ... ('method', '=', 'marketing.automation.record.activity|process'),
... ])
>>> cron_trigger.click('run_once')
>>> cron_process.click('run_once')