Set invoice progress of shipment cost line of sale always as 100%

Closes #13160
This commit is contained in:
Cédric Krier
2024-04-04 15:13:36 +02:00
parent 3a25fc0df9
commit b0d38bd797
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -436,6 +436,13 @@ class Line(metaclass=PoolMeta):
shipment_cost_invoiced.append(shipment.id)
return lines
@property
def _invoice_remaining_quantity(self):
quantity = super()._invoice_remaining_quantity
if self.shipment_cost is not None:
quantity = 0
return quantity
def _get_invoice_line_quantity(self):
quantity = super()._get_invoice_line_quantity()
if self.shipment_cost is not None:
@@ -127,6 +127,8 @@ Sale products with cost on shipment::
1.0
>>> cost_line.amount
Decimal('3.00')
>>> cost_line.invoice_progress
1.0
>>> sale.click('confirm')
>>> sale.click('process')
>>> sale.state
@@ -211,6 +213,8 @@ Sale products with cost on order::
1.0
>>> cost_line.amount
Decimal('3.00')
>>> cost_line.invoice_progress
1.0
>>> sale.click('confirm')
>>> sale.click('process')
>>> sale.state