From 4df5c1da1829343f811206eba26ea28cf1dd4e9b Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Thu, 1 May 2008 15:48:04 +0200 Subject: [PATCH] Added a function to choose where are stored incoming products --- packing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packing.py b/packing.py index a0aad12a14..5c4d277f1c 100644 --- a/packing.py +++ b/packing.py @@ -98,6 +98,9 @@ class PackingIn(OSV): return super(PackingIn, self).create( cursor, user, values, context=context) + def _store_location(self, cursor, user, incoming_move, context=None): + return incoming_move.incoming_packing_in.warehouse.storage_location.id + def create_inventory_moves(self, cursor, user, ids, context=None): move_obj = self.pool.get('stock.move') for packing in self.browse(cursor, user, ids, context=context): @@ -120,7 +123,8 @@ class PackingIn(OSV): 'uom': move.uom.id, 'quantity': move.quantity, 'from_location': move.to_location.id, - 'to_location': packing.warehouse.storage_location.id, + 'to_location': self._store_location( + cursor, user, move, context=context), 'inventory_packing_in': packing.id, 'state': 'waiting', }