From f6ef0c776096774fc4c6821449ab42cfc2f53e62 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 10 Jan 2018 18:04:38 +0100 Subject: [PATCH] [FIX] sale_mrp: correct test when `delivery` is installed --- addons/sale_mrp/tests/test_sale_mrp_flow.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/sale_mrp/tests/test_sale_mrp_flow.py b/addons/sale_mrp/tests/test_sale_mrp_flow.py index c67f41660b9..f6268534ef7 100644 --- a/addons/sale_mrp/tests/test_sale_mrp_flow.py +++ b/addons/sale_mrp/tests/test_sale_mrp_flow.py @@ -335,8 +335,15 @@ class TestSaleMrpFlow(common.TransactionCase): product.invoice_policy = 'delivery' # Remove the MTO route as purchase is not installed and since the procurement removal the exception is directly raised product.write({'route_ids': [(6, 0, [self.warehouse.manufacture_pull_id.route_id.id])]}) + + partner = self.env.ref('base.res_partner_1') + # if `delivery` module is installed, a default property is set for the carrier to use + # However this will lead to an extra line on the SO (the delivery line), which will force + # the SO to have a different flow (and `invoice_state` value) + partner.property_delivery_carrier_id = False + f = Form(self.env['sale.order']) - f.partner_id = self.env.ref('base.res_partner_1') + f.partner_id = partner with f.order_line.new() as line: line.product_id = product line.product_uom_qty = 5