~pexego/openobject-addons/6.0-pexego

« back to all changes in this revision

Viewing changes to stock/wizard/stock_fill_inventory.py

  • Committer: Omar (pexego)
  • Date: 2011-07-07 12:40:45 UTC
  • Revision ID: omar@pexego.es-20110707124045-pi5e3l25m2jws5qb
[FIX] Fixes bug: https://bugs.launchpad.net/openobject-addons/+bug/797772 Fill inventory wizard computed wrong quantities

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
            for move in move_obj.browse(cr, uid, move_ids, context=context):
92
92
                lot_id = move.prodlot_id.id
93
93
                prod_id = move.product_id.id
 
94
                uom = move.product_uom.id
94
95
                qty = move.product_qty
95
96
                
96
 
                if datas.get((prod_id, lot_id)):
97
 
                    qty += datas[(prod_id, lot_id)]['product_qty']
98
 
                
 
97
                context.update({'uom':uom ,'prodlot_id':lot_id})
 
98
                if lot_id:
 
99
                    qty = location_obj._product_get(cr, uid, location, [prod_id],context=context)[prod_id]
99
100
                datas[(prod_id, lot_id)] = {'product_id': prod_id, 'location_id': location, 'product_qty': qty, 'product_uom': move.product_id.uom_id.id, 'prod_lot_id': lot_id}
100
101
            
101
102
            if datas: