diff --git a/modules/sale_shipment_cost/sale.py b/modules/sale_shipment_cost/sale.py index 51eacb4e97..ab0c5c38b2 100644 --- a/modules/sale_shipment_cost/sale.py +++ b/modules/sale_shipment_cost/sale.py @@ -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: diff --git a/modules/sale_shipment_cost/tests/scenario_sale_shipment_cost.rst b/modules/sale_shipment_cost/tests/scenario_sale_shipment_cost.rst index 83e6876e2e..f85d6f1a4f 100644 --- a/modules/sale_shipment_cost/tests/scenario_sale_shipment_cost.rst +++ b/modules/sale_shipment_cost/tests/scenario_sale_shipment_cost.rst @@ -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