Use line's get_move_product_types to require incoterm

Closes #14332

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2025-10-30 01:00:12 +01:00
parent 7197fabe39
commit b02c49c30d
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -32,7 +32,9 @@ class Purchase(IncotermAvailableMixin, metaclass=PoolMeta):
super().check_for_quotation()
if not self.incoterm and self._incoterm_required:
for line in self.lines:
if line.product and line.product.type in {'goods', 'assets'}:
if (line.product
and line.product.type in line.get_move_product_types()
):
raise PurchaseQuotationError(
gettext('incoterm'
'.msg_purchase_incoterm_required_for_quotation',
+3 -1
View File
@@ -51,7 +51,9 @@ class Sale(IncotermAvailableMixin, metaclass=PoolMeta):
super().check_for_quotation()
if not self.incoterm and self._incoterm_required:
for line in self.lines:
if line.product and line.product.type in {'goods', 'assets'}:
if (line.product
and line.product.type in line.get_move_product_types()
):
raise SaleQuotationError(
gettext('incoterm'
'.msg_sale_incoterm_required_for_quotation',