Send only the required fields when fetching a readonly view definition
issue11134 review380081002
This commit is contained in:
+1
-5
@@ -15,15 +15,13 @@ class SaleSecondaryMixin:
|
||||
'product.uom', "Sale Secondary UOM",
|
||||
domain=[
|
||||
('category', '!=', Eval('default_uom_category')),
|
||||
],
|
||||
depends=['default_uom_category'])
|
||||
])
|
||||
sale_secondary_uom_factor = fields.Float(
|
||||
"Sale Secondary UOM Factor", digits=uom_conversion_digits,
|
||||
states={
|
||||
'required': Bool(Eval('sale_secondary_uom')),
|
||||
'invisible': ~Eval('sale_secondary_uom'),
|
||||
},
|
||||
depends=['sale_secondary_uom'],
|
||||
help="The coefficient for the formula:\n"
|
||||
"1 (sale unit) = coefficient (secondary unit)")
|
||||
sale_secondary_uom_rate = fields.Float(
|
||||
@@ -32,7 +30,6 @@ class SaleSecondaryMixin:
|
||||
'required': Bool(Eval('sale_secondary_uom')),
|
||||
'invisible': ~Eval('sale_secondary_uom'),
|
||||
},
|
||||
depends=['sale_secondary_uom'],
|
||||
help="The coefficient for the formula:\n"
|
||||
"coefficient (sale unit) = 1 (secondary unit)")
|
||||
sale_secondary_uom_category = fields.Function(
|
||||
@@ -123,7 +120,6 @@ class Template(SaleSecondaryMixin, metaclass=PoolMeta):
|
||||
cls.sale_secondary_uom.states = {
|
||||
'invisible': ~Eval('salable', False),
|
||||
}
|
||||
cls.sale_secondary_uom.depends.append('salable')
|
||||
|
||||
|
||||
class Product(metaclass=PoolMeta):
|
||||
|
||||
@@ -16,8 +16,7 @@ class Line(metaclass=PoolMeta):
|
||||
'invisible': ((Eval('type') != 'line')
|
||||
| ~Eval('secondary_unit')),
|
||||
'readonly': Eval('sale_state') != 'draft',
|
||||
},
|
||||
depends=['type', 'secondary_unit', 'sale_state']),
|
||||
}),
|
||||
'on_change_with_secondary_quantity', setter='set_secondary')
|
||||
secondary_unit = fields.Many2One(
|
||||
'product.uom', "Secondary Unit", ondelete='RESTRICT',
|
||||
@@ -31,17 +30,14 @@ class Line(metaclass=PoolMeta):
|
||||
| (~Eval('secondary_uom_factor')
|
||||
& ~Eval('secondary_uom_rate'))),
|
||||
'readonly': Eval('sale_state') != 'draft',
|
||||
},
|
||||
depends=['product_secondary_uom_category', 'type',
|
||||
'secondary_uom_factor', 'secondary_uom_rate', 'sale_state'])
|
||||
})
|
||||
secondary_unit_price = fields.Function(Monetary(
|
||||
"Secondary Unit Price", currency='currency', digits=price_digits,
|
||||
states={
|
||||
'invisible': ((Eval('type') != 'line')
|
||||
| ~Eval('secondary_unit')),
|
||||
'readonly': Eval('sale_state') != 'draft',
|
||||
},
|
||||
depends=['type', 'secondary_unit', 'sale_state']),
|
||||
}),
|
||||
'on_change_with_secondary_unit_price', setter='set_secondary')
|
||||
|
||||
secondary_uom_factor = fields.Float("Secondary UOM Factor")
|
||||
|
||||
Reference in New Issue
Block a user