From e3954a3457bffd7c8e5ea09ac9c4802e3cd307dc Mon Sep 17 00:00:00 2001 From: Alex Comba Date: Tue, 21 Jun 2016 11:24:20 +0200 Subject: [PATCH] [FIX] stock: fix AccessError on stock.quant while trying to resolve an inventory line linked to a package closes #12511 --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 591dca6652c..ad0d63a818f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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: