From 79a56f6ceedd6d102308f0be5bc6236f54b47603 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Thu, 17 Apr 2008 21:39:21 +0200 Subject: [PATCH] Removed wrong on_change on warehouse. --- packing.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/packing.py b/packing.py index 4f44b762e5..cc4ca19408 100644 --- a/packing.py +++ b/packing.py @@ -164,8 +164,7 @@ class PackingOut(OSV): effective_date =fields.DateTime('Effective Date', readonly=True) planned_date = fields.DateTime('Planned Date', readonly=True) warehouse = fields.Many2One( - 'stock.warehouse',"Warehouse", required=True, - states=STATES, on_change=['warehouse']) + 'stock.warehouse',"Warehouse", required=True, states=STATES,) outgoing_moves = fields.One2Many( 'stock.move', 'outgoing_packing_out', 'Outgoing Moves', states=STATES, @@ -198,28 +197,6 @@ class PackingOut(OSV): def default_state(self, cursor, user, context=None): return 'draft' - def on_change_warehouse(self, cursor, user, ids, value, context=None): - move_obj = self.pool.get('stock.move') - if 'warehouse' in value and value['warehouse']: - warehouse = self.pool.get('stock.warehouse').browse( - cursor, user, value['warehouse'], context=context) - outgoing_moves= [] - inventory_moves= [] - for packing in self.browse(cursor, user, ids, context=context): - outgoing_moves.extend([m.id for m in packing.outgoing_moves]) - inventory_moves.extend([m.id for m in packing.inventory_moves]) - if outgoing_moves: - move_obj.write( - cursor, user, outgoing_moves, - {'from_location': warehouse.output_location.id}, - context=context) - if inventory_moves: - move_obj.write( - cursor, user, inventory_moves, - {'to_location': warehouse.output_location.id}, - context=context) - return {} - def set_state_done(self, cursor, user, packing_id, context=None): move_obj = self.pool.get('stock.move') packing = self.browse(cursor, user, packing_id, context=context)