[FIX] stock: fix AccessError on stock.quant while trying to resolve an inventory line linked to a package closes #12511

This commit is contained in:
Alex Comba 2016-06-21 11:24:20 +02:00 committed by Josse Colpaert
parent 75dbd545c8
commit e3954a3457
1 changed files with 1 additions and 1 deletions

View File

@ -3031,7 +3031,7 @@ class stock_inventory_line(osv.osv):
elif inventory_line.package_id:
stock_move_obj.action_done(cr, uid, move_id, context=context)
quants = [x.id for x in move.quant_ids]
quant_obj.write(cr, uid, quants, {'package_id': inventory_line.package_id.id}, context=context)
quant_obj.write(cr, SUPERUSER_ID, quants, {'package_id': inventory_line.package_id.id}, context=context)
res = quant_obj.search(cr, uid, [('qty', '<', 0.0), ('product_id', '=', move.product_id.id),
('location_id', '=', move.location_dest_id.id), ('package_id', '!=', False)], limit=1, context=context)
if res: