mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] product_contract: Migration to 16.0
This commit is contained in:
@@ -68,12 +68,12 @@ class ProductTemplate(models.Model):
|
||||
self.with_company(company).write(
|
||||
{"property_contract_template_id": False}
|
||||
)
|
||||
super().write(vals)
|
||||
return super().write(vals)
|
||||
|
||||
@api.constrains("is_contract", "type")
|
||||
def _check_contract_product_type(self):
|
||||
"""
|
||||
Contract product should be service type
|
||||
"""
|
||||
if self.is_contract and self.type != "service":
|
||||
if any([product.is_contract and product.type != "service" for product in self]):
|
||||
raise ValidationError(_("Contract product should be service type"))
|
||||
|
||||
Reference in New Issue
Block a user