[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) <nim@odoo.com>
This commit is contained in:
IEL
2020-10-13 15:11:47 +00:00
parent 4841e5c690
commit 6aa8e7b51d
+1 -1
View File
@@ -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',