From ec681480d659dd4aafe5dfdff0089e8406413518 Mon Sep 17 00:00:00 2001 From: Ralf Peschke Date: Thu, 31 Dec 2015 13:31:06 +0100 Subject: [PATCH] Set product on invoice line with cost method 'shipment' issue5196 review19711002 --- stock.py | 1 + tests/scenario_sale_shipment_cost.rst | 3 +++ 2 files changed, 4 insertions(+) diff --git a/stock.py b/stock.py index 69518c6c98..b59a6dd830 100644 --- a/stock.py +++ b/stock.py @@ -89,6 +89,7 @@ class ShipmentOut: invoice_line = InvoiceLine() product = self.carrier.carrier_product invoice_line.type = 'line' + invoice_line.product = product party = invoice.party party_context = {} diff --git a/tests/scenario_sale_shipment_cost.rst b/tests/scenario_sale_shipment_cost.rst index 166f555a90..2529c36bc8 100644 --- a/tests/scenario_sale_shipment_cost.rst +++ b/tests/scenario_sale_shipment_cost.rst @@ -176,6 +176,9 @@ Check customer invoice:: >>> sale.reload() >>> invoice, = sale.invoices + >>> sorted([l.product for l in invoice.lines]) == \ + ... sorted([product, carrier_product]) + True >>> invoice.untaxed_amount Decimal('83.00')