Send only the required fields when fetching a readonly view definition
issue11134 review380081002
This commit is contained in:
1 parent
22b762d769
commit
f7c64e7bd5
1 file changed
+3
-7
@@ -30,29 +30,25 @@ class ShipmentCostMixin:
|
||||
|
||||
carrier = fields.Many2One('carrier', 'Carrier', states={
|
||||
'readonly': Eval('state').in_(['done', 'cancelled']),
|
||||
},
|
||||
depends=['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_(['done', 'cancelled']),
|
||||
},
|
||||
depends=['state'])
|
||||
})
|
||||
cost_edit = fields.Boolean(
|
||||
"Edit Cost",
|
||||
states={
|
||||
'readonly': Eval('state').in_(['done', 'cancelled']),
|
||||
},
|
||||
depends=['state'],
|
||||
help="Check to edit the cost.")
|
||||
|
||||
def _get_carrier_context(self):
|
||||
|
||||
Reference in new issue
Block a user