diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py index 698835a6a1b60..6de786f084baa 100644 --- a/addons/stock/wizard/stock_fill_inventory.py +++ b/addons/stock/wizard/stock_fill_inventory.py @@ -110,9 +110,8 @@ def fill_inventory(self, cr, uid, ids, context=None): local_context = dict(context) local_context['raise-exception'] = False # To avoid running out of memory, process limited batches - for i in range(0, len(all_move_ids), self.MAX_IMPORT_LINES): - move_ids = all_move_ids[i * self.MAX_IMPORT_LINES: - (i + 1) * self.MAX_IMPORT_LINES] + for i in xrange(0, len(all_move_ids), self.MAX_IMPORT_LINES): + move_ids = all_move_ids[i:i+self.MAX_IMPORT_LINES] for move in move_obj.browse(cr, uid, move_ids, context=context): lot_id = move.prodlot_id.id prod_id = move.product_id.id