From 6aa8e7b51d70346633ff35e7bf3bb0a7c1899690 Mon Sep 17 00:00:00 2001 From: IEL Date: Thu, 8 Oct 2020 13:58:29 +0000 Subject: [PATCH] [FIX] delivery: choose delivery method by partner_shipping_id Steps: * Create a delivery method (1) restricted to Spain (any country would do) * Create a delivery method (2) restricted to Madagascar (same) * Create a partner, main company, whose country is Spain and the default delivery method is the first one. * Create a delivery address for that customer with Madagascar as country and the default delivery method as the second one. * Now place a new quotation with such partner and set the delivery address to the one of Madagascar (multiple addresses setting must be on). Before: * The delivery method for the quotation is set to the one restricted to Spain although we're sending it to Madagascar. After: * The delivery method for the quotation is set to the one restricted to Madagascar. --- opw-2348336 closes odoo/odoo#59890 X-original-commit: 535d429960a0347d01c528c2440c2b8e9ff2fb51 Signed-off-by: Nicolas Martinelli (nim) --- addons/delivery/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py index 10fd1d9cea4..d1100ecbde9 100644 --- a/addons/delivery/models/sale_order.py +++ b/addons/delivery/models/sale_order.py @@ -56,7 +56,7 @@ class SaleOrder(models.Model): carrier = self.carrier_id else: name = _('Add a shipping method') - carrier = self.with_company(self.company_id).partner_id.property_delivery_carrier_id + carrier = self.with_company(self.company_id).partner_shipping_id.property_delivery_carrier_id return { 'name': name, 'type': 'ir.actions.act_window',