From bf149120723137bd0b60daf366c818b9a77258cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 4 Dec 2008 18:34:30 +0100 Subject: [PATCH] Fix set_xxx_moves when value is False --- packing.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packing.py b/packing.py index bd6d2c6c2b..0f3d8fcf87 100644 --- a/packing.py +++ b/packing.py @@ -114,6 +114,10 @@ class PackingIn(OSV): def set_incoming_moves(self, cursor, user, packing_id, name, value, arg, context=None): move_obj = self.pool.get('stock.move') + + if not value: + return + packing = self.browse(cursor, user, packing_id, context=context) move_ids = [] for act in value: @@ -157,6 +161,10 @@ class PackingIn(OSV): def set_inventory_moves(self, cursor, user, packing_id, name, value, arg, context=None): move_obj = self.pool.get('stock.move') + + if not value: + return + packing = self.browse(cursor, user, packing_id, context=context) move_ids = [] for act in value: @@ -383,6 +391,10 @@ class PackingOut(OSV): def set_outgoing_moves(self, cursor, user, packing_id, name, value, arg, context=None): move_obj = self.pool.get('stock.move') + + if not value: + return + packing = self.browse(cursor, user, packing_id, context=context) move_ids = [] for act in value: @@ -426,6 +438,10 @@ class PackingOut(OSV): def set_inventory_moves(self, cursor, user, packing_id, name, value, arg, context=None): move_obj = self.pool.get('stock.move') + + if not value: + return + packing = self.browse(cursor, user, packing_id, context=context) move_ids = [] for act in value: