changeset 06fca9d72cd8 in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=06fca9d72cd8
description:
        Limit start dates before dates on internal shipment

        The internal shipment must start before it ends.

        issue11338
        review382211002
diffstat:

 shipment.py |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 40e1b40957ed -r 06fca9d72cd8 shipment.py
--- a/shipment.py       Wed Apr 06 18:24:28 2022 +0200
+++ b/shipment.py       Wed Apr 06 18:44:46 2022 +0200
@@ -2031,17 +2031,27 @@
             }, depends=['state'],
         help="When the shipment is expected to be completed.")
     effective_start_date = fields.Date('Effective Start Date',
+        domain=[
+            If(Eval('effective_start_date') & Eval('effective_date'),
+                ('effective_start_date', '<=', Eval('effective_date')),
+                ()),
+            ],
         states={
             'readonly': Eval('state').in_(['cancelled', 'shipped', 'done']),
             },
-        depends=['state'],
+        depends=['effective_date', 'state'],
         help="When the stock was actually sent.")
     planned_start_date = fields.Date('Planned Start Date',
+        domain=[
+            If(Eval('planned_start_date') & Eval('planned_date'),
+                ('planned_start_date', '<=', Eval('planned_date')),
+                ()),
+            ],
         states={
             'readonly': ~Eval('state').in_(['request', 'draft']),
             'required': Bool(Eval('planned_date')),
             },
-        depends=['state'],
+        depends=['planned_date', 'state'],
         help="When the stock is expected to be sent.")
     company = fields.Many2One(
         'company.company', "Company", required=True,

Reply via email to