Skip to content

Commit b415b0e

Browse files
author
Pretecno
committed
Merge branch '14.0-fix-product_contract-recordset' of git+ssh://github.com/efatto/contract into 14.0
2 parents 81a9385 + 90aca03 commit b415b0e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

product_contract/models/product_template.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ def write(self, vals):
7373
@api.constrains("is_contract", "type")
7474
def _check_contract_product_type(self):
7575
"""
76-
Contract product should be service type
76+
Contract product should be service type, check by recordset
7777
"""
78-
if self.is_contract and self.type != "service":
79-
raise ValidationError(_("Contract product should be service type"))
78+
for record in self:
79+
if record.is_contract and record.type != "service":
80+
raise ValidationError(
81+
_(
82+
"Contract product (%(product_name)s) should be service type",
83+
product_name=record.name,
84+
)
85+
)

0 commit comments

Comments
 (0)