From 62b9acbc37610013d6c19c185a8dab40d6266e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 8 Oct 2015 19:46:04 +0200 Subject: [PATCH] supply_on_sale should not always return True if there is no moves issue5017 review20441003 --- sale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sale.py b/sale.py index 4fad8a1126..52e576d7fb 100644 --- a/sale.py +++ b/sale.py @@ -66,8 +66,8 @@ class SaleLine: def supply_on_sale(self): supply_on_sale = super(SaleLine, self).supply_on_sale return (supply_on_sale - or all(m.from_location.type == 'drop' - for m in self.moves)) + or (self.moves and all(m.from_location.type == 'drop' + for m in self.moves))) def get_move(self, shipment_type): result = super(SaleLine, self).get_move(shipment_type)