changeset 68ddc885345d in modules/purchase:6.0
details: https://hg.tryton.org/modules/purchase?cmd=changeset&node=68ddc885345d
description:
Do not show edited delivery date once the purchase is processed
We must show the computed delivery date once the edition is not more
possible
issue10394
review348341002
(grafted from 2ff2430b92ac448a68fa56bb1757e82f704b9ae8)
diffstat:
purchase.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 4142a8d567a7 -r 68ddc885345d purchase.py
--- a/purchase.py Mon May 03 15:54:34 2021 +0200
+++ b/purchase.py Mon May 10 12:39:02 2021 +0200
@@ -1165,9 +1165,11 @@
delivery_date = fields.Function(fields.Date('Delivery Date',
states={
'invisible': ((Eval('type') != 'line')
- | Eval('delivery_date_edit', False)),
+ | (Eval('delivery_date_edit', False)
+ & ~Eval('purchase_state').in_(
+ ['processing', 'done', 'cancelled']))),
},
- depends=['type', 'delivery_date_edit']),
+ depends=['type', 'delivery_date_edit', 'purchase_state']),
'on_change_with_delivery_date')
delivery_date_edit = fields.Boolean(
"Edit Delivery Date",
@@ -1182,7 +1184,9 @@
"Delivery Date",
states={
'invisible': ((Eval('type') != 'line')
- | ~Eval('delivery_date_edit', False)),
+ | ~Eval('delivery_date_edit', False)
+ | Eval('purchase_state').in_(
+ ['processing', 'done', 'cancelled'])),
'readonly': Eval('purchase_state').in_([
'processing', 'done', 'cancelled']),
},