From 739b31f693d8eba3c8f2fc1394e5f1617b3368d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20L=C3=B3pez?= Date: Mon, 27 Oct 2014 10:29:23 +0100 Subject: [PATCH] =?UTF-8?q?semillero-126=20Gesti=C3=B3n=20de=20costes:=20S?= =?UTF-8?q?ubreglas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stock.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stock.py b/stock.py index 2d035ba..3382f13 100644 --- a/stock.py +++ b/stock.py @@ -38,10 +38,11 @@ class Lot: with_childs=with_childs, grouping=grouping) keys_todel = [] - if lot_ids: - for key, quantity in pbl.iteritems(): - if key[2] not in lot_ids: - keys_todel.append(key) + for key, quantity in pbl.iteritems(): + if lot_ids and key[2] and key[2] not in lot_ids: + keys_todel.append(key) + if not key[2]: + keys_todel.append(key) if keys_todel: for k in keys_todel: del pbl[k]