Do not use supplier location if empty

issue10240
review350071002
(grafted from 9d974b18ef9d11a7f4a62c044d4f1110d39f559c)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2021-07-12 22:37:21 +02:00
1 parent 78525a20f4
commit d7d1fe5d58
1 file changed
+3 -2
+3 -2
View File
@@ -1433,7 +1433,8 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
def get_from_location(self, name):
if (self.quantity or 0) >= 0:
return self.purchase.party.supplier_location.id
if self.purchase.party.supplier_location:
return self.purchase.party.supplier_location.id
elif self.purchase.return_from_location:
return self.purchase.return_from_location.id
@@ -1441,7 +1442,7 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
if (self.quantity or 0) >= 0:
if self.purchase.warehouse:
return self.purchase.warehouse.input_location.id
else:
elif self.purchase.party.supplier_location:
return self.purchase.party.supplier_location.id
@fields.depends('moves', methods=['planned_delivery_date'])