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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user