From 4cd7175fb9c246cfe3dc376bd088eb8385d01c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 20 Mar 2017 10:47:23 +0100 Subject: [PATCH] Use shipment_party location when available The shipment will use the shipment_party so the location of moves should also otherwise the outgoing move domain is not respected. issue6368 review33231002 --- sale.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sale.py b/sale.py index 2cade88e49..f4abf250ed 100644 --- a/sale.py +++ b/sale.py @@ -1277,11 +1277,13 @@ class SaleLine(sequence_ordered(), ModelSQL, ModelView): if self.warehouse: return self.warehouse.output_location.id else: - return self.sale.party.customer_location.id + party = self.sale.shipment_party or self.sale.party + return party.customer_location.id def get_to_location(self, name): if (self.quantity or 0) >= 0: - return self.sale.party.customer_location.id + party = self.sale.shipment_party or self.sale.party + return party.customer_location.id else: if self.warehouse: return self.warehouse.input_location.id