Skip to content

Commit

Permalink
[FIX] delivery: Delivery method zip using the customer not shipping a…
Browse files Browse the repository at this point in the history
…ddress

The available_carriers must be computed according to the shipping address.

opw:1967445

closes #32693

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
  • Loading branch information
simongoffin committed Apr 15, 2019
1 parent 027ff77 commit ae61ed7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/delivery/models/sale_order.py
Expand Up @@ -25,7 +25,7 @@ def _compute_amount_total_without_delivery(self):
def _compute_available_carrier(self):
carriers = self.env['delivery.carrier'].search([])
for rec in self:
rec.available_carrier_ids = carriers.available_carriers(rec.partner_id) if rec.partner_id else carriers
rec.available_carrier_ids = carriers.available_carriers(rec.partner_shipping_id) if rec.partner_id else carriers

def get_delivery_price(self):
for order in self.filtered(lambda o: o.state in ('draft', 'sent') and len(o.order_line) > 0):
Expand Down

0 comments on commit ae61ed7

Please sign in to comment.