changeset 2eee3d9e4705 in modules/marketing_automation:default
details: 
https://hg.tryton.org/modules/marketing_automation?cmd=changeset&node=2eee3d9e4705
description:
        Enforce positive timedelta

        issue11869
        review421921004
diffstat:

 marketing_automation.py |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r f15a6a30deef -r 2eee3d9e4705 marketing_automation.py
--- a/marketing_automation.py   Sat Nov 05 09:53:11 2022 +0100
+++ b/marketing_automation.py   Thu Nov 24 19:16:51 2022 +0100
@@ -28,7 +28,7 @@
     EvalEnvironment, Index, ModelSQL, ModelView, Unique, Workflow, dualmethod,
     fields)
 from trytond.pool import Pool
-from trytond.pyson import Eval, If, PYSONDecoder
+from trytond.pyson import Eval, If, PYSONDecoder, TimeDelta
 from trytond.report import Report
 from trytond.sendmail import SMTPDataManager, sendmail_transactional
 from trytond.tools import grouped_slice, reduce_ids
@@ -303,6 +303,10 @@
 
     delay = fields.TimeDelta(
         "Delay",
+        domain=[
+            ('delay', '=', None),
+            ('delay', '>=', TimeDelta()),
+            ],
         states={
             'required': Eval('negative', False),
             },

Reply via email to