Use declarative index definition for ModelSQL

issue5757
review361251002
This commit is contained in:
Cédric Krier committed 2022-10-11 00:44:51 +02:00
1 parent c3bde0d451
commit 07292f640f
1 file changed
+7 -7
+7 -7
View File
@@ -19,8 +19,8 @@ class OrderPoint(ModelSQL, ModelView):
considered by the supply scheduler to generate purchase requests.
"""
__name__ = 'stock.order_point'
product = fields.Many2One('product.product', 'Product', required=True,
select=True,
product = fields.Many2One(
'product.product', "Product", required=True,
domain=[
('type', '=', 'goods'),
('consumable', '=', False),
@@ -31,15 +31,15 @@ class OrderPoint(ModelSQL, ModelView):
'company': Eval('company', -1),
},
depends={'company'})
warehouse_location = fields.Many2One('stock.location',
'Warehouse Location', select=True,
warehouse_location = fields.Many2One(
'stock.location', 'Warehouse Location',
domain=[('type', '=', 'warehouse')],
states={
'invisible': Not(Equal(Eval('type'), 'purchase')),
'required': Equal(Eval('type'), 'purchase'),
})
storage_location = fields.Many2One('stock.location', 'Storage Location',
select=True,
storage_location = fields.Many2One(
'stock.location', "Storage Location",
domain=[('type', '=', 'storage')],
states={
'invisible': Not(Equal(Eval('type'), 'internal')),
@@ -66,7 +66,7 @@ class OrderPoint(ModelSQL, ModelView):
type = fields.Selection(
[('internal', 'Internal'),
('purchase', 'Purchase')],
'Type', select=True, required=True)
"Type", required=True)
min_quantity = fields.Float(
"Minimal Quantity", digits='unit',
states={