Check only shipment with cost method 'order' to invoice shipment cost on order

If the sale is linked to a shipment with a different cost method than order,
it should not be considered to decide to invoice or not the sale shipment
cost.

Closes #13171
This commit is contained in:
Cédric Krier
2024-04-08 17:45:01 +02:00
parent 49bd15c94e
commit 14c5a40342
+2 -1
View File
@@ -450,7 +450,8 @@ class Line(metaclass=PoolMeta):
quantity = 0
elif (self.sale.shipment_cost_method == 'order'
and self.sale.invoice_method == 'shipment'):
shipments = self.sale.shipments
shipments = [
s for s in self.sale.shipments if s.cost_method == 'order']
if (not shipments
or all(s.state != 'done' for s in shipments)):
quantity = 0