Prevent changing party, template and product on product customer

Closes #12607
This commit is contained in:
Maxime Richez
2023-10-26 22:52:55 +02:00
parent ff376d7d01
commit 5774bd2c32
+13 -4
View File
@@ -22,7 +22,10 @@ class ProductCustomer(
('products', '=', Eval('product')),
()),
If(Eval('active'), ('active', '=', True), ()),
])
],
states={
'readonly': Eval('id', -1) >= 0,
})
product = fields.Many2One(
'product.product', "Variant",
domain=[
@@ -30,9 +33,15 @@ class ProductCustomer(
('template', '=', Eval('template')),
()),
If(Eval('active'), ('active', '=', True), ()),
])
party = fields.Many2One('party.party', "Customer", required=True,
ondelete='CASCADE')
],
states={
'readonly': Eval('id', -1) >= 0,
})
party = fields.Many2One(
'party.party', "Customer", required=True, ondelete='CASCADE',
states={
'readonly': Eval('id', -1) >= 0,
})
name = fields.Char("Name", translate=True)
code = fields.Char("Code")