changeset 49fa6a5f196e in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=49fa6a5f196e
description:
Enforce positive timedelta
issue11869
review421921004
diffstat:
location.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r 4c66434fc3c7 -r 49fa6a5f196e location.py
--- a/location.py Sat Nov 05 10:08:31 2022 +0100
+++ b/location.py Thu Nov 24 19:16:51 2022 +0100
@@ -13,7 +13,7 @@
sequence_ordered, tree)
from trytond.modules.product import price_digits, round_price
from trytond.pool import Pool
-from trytond.pyson import Eval, If
+from trytond.pyson import Eval, If, TimeDelta
from trytond.tools import grouped_slice
from trytond.transaction import Transaction
@@ -747,7 +747,12 @@
('type', '=', 'warehouse'),
('id', '!=', Eval('warehouse_from', -1)),
])
- lead_time = fields.TimeDelta('Lead Time',
+ lead_time = fields.TimeDelta(
+ "Lead Time",
+ domain=['OR',
+ ('lead_time', '=', None),
+ ('lead_time', '>=', TimeDelta()),
+ ],
help="The time it takes to move stock between the warehouses.")
@classmethod