changeset bb041b39f113 in modules/purchase_shipment_cost:default
details:
https://hg.tryton.org/modules/purchase_shipment_cost?cmd=changeset&node=bb041b39f113
description:
Send only the required fields when fetching a readonly view definition
issue11134
review380081002
diffstat:
stock.py | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diffs (54 lines):
diff -r 6991877602a1 -r bb041b39f113 stock.py
--- a/stock.py Wed Apr 06 23:37:43 2022 +0200
+++ b/stock.py Fri Apr 08 19:07:13 2022 +0200
@@ -14,15 +14,13 @@
__name__ = 'stock.shipment.in'
carrier = fields.Many2One('carrier', 'Carrier', states={
'readonly': Eval('state') != 'draft',
- },
- depends=['state'])
+ })
cost_currency_used = fields.Function(fields.Many2One(
'currency.currency', "Cost Currency",
states={
'invisible': Eval('cost_edit', False),
- },
- depends=['cost_edit']),
+ }),
'on_change_with_cost_currency_used')
cost_currency = fields.Many2One(
'currency.currency', "Cost Currency",
@@ -30,29 +28,25 @@
'required': Bool(Eval('cost')),
'invisible': ~Eval('cost_edit', False),
'readonly': ~Eval('state').in_(['draft']),
- },
- depends=['cost', 'cost_edit', 'state'])
+ })
cost_used = fields.Function(fields.Numeric(
"Cost", digits=price_digits,
states={
'invisible': Eval('cost_edit', False),
- },
- depends=['cost_edit']),
+ }),
'on_change_with_cost_used')
cost = fields.Numeric(
"Cost", digits=price_digits,
states={
'invisible': ~Eval('cost_edit', False),
'readonly': ~Eval('state').in_(['draft']),
- },
- depends=['cost_edit', 'state'])
+ })
cost_edit = fields.Boolean(
"Edit Cost",
states={
'readonly': ~Eval('state').in_(['draft']),
},
- depends=['state'],
help="Check to edit the cost.")
def _get_carrier_context(self):