Use line's get_move_product_types to require incoterm
Closes #14332 --HG-- branch : 7.0
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user