[FIX] Stock : Fixed the problem suggested by Buildbot
[odoo/odoo.git] / addons / stock / wizard / stock_split_move.py
index fb024b6..aa7e4c1 100644 (file)
@@ -108,8 +108,7 @@ class stock_split_move_line(osv.osv_memory):
         pick_obj = self.pool.get('stock.picking')
         pick = pick_obj.browse(cr, uid, record_id, context=context)
         data = self.read(cr, uid, ids[0])
-        move_ids = [m.id for m in [line for line in pick.move_lines]]
-        for move in move_obj.browse(cr, uid, move_ids, context=context):
+        for move in pick.move_lines:
             quantity = data['move%s' % move.id]
             if 0 < quantity < move.product_qty:
                 new_qty = move.product_qty - quantity
@@ -117,7 +116,7 @@ class stock_split_move_line(osv.osv_memory):
                 new_obj = move_obj.copy(cr, uid, move.id, {'product_qty' : new_qty, 'product_uos_qty': new_uos_qty, 'state':move.state})
                 uos_qty = quantity / move.product_qty * move.product_uos_qty
                 move_obj.write(cr, uid, [move.id], {'product_qty' : quantity, 'product_uos_qty': uos_qty})
-        return {}
+        return {'type': 'ir.actions.act_window_close'}
     
 stock_split_move_line()