Skip to content

Commit

Permalink
Merge branch '14.0-fix-product_contract-recordset' of git+ssh://githu…
Browse files Browse the repository at this point in the history
…b.com/efatto/contract into 14.0
  • Loading branch information
Pretecno committed Jan 11, 2025
2 parents 3158c53 + 90aca03 commit 33d4a94
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions product_contract/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ def write(self, vals):
@api.constrains("is_contract", "type")
def _check_contract_product_type(self):
"""
Contract product should be service type
Contract product should be service type, check by recordset
"""
if self.is_contract and self.type != "service":
raise ValidationError(_("Contract product should be service type"))
for record in self:
if record.is_contract and record.type != "service":
raise ValidationError(
_(
"Contract product (%(product_name)s) should be service type",
product_name=record.name,
)
)

0 comments on commit 33d4a94

Please sign in to comment.