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
This commit is contained in:
Cédric Krier committed 2017-03-20 10:47:23 +01:00
1 parent 2333ac8f7f
commit 4cd7175fb9
1 file changed
+4 -2
+4 -2
View File
@@ -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