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: