From 61300ee7f135df81106f624544eb4f8767c189c2 Mon Sep 17 00:00:00 2001 From: Ruchir Shukla Date: Wed, 16 Sep 2015 11:17:23 +0530 Subject: [PATCH] [FIX] stock_landed_costs: modify quants as admin Nobody has write access to stock.quants so only the admin was able to execute this method. Fix it by using SUPERUSER_ID Closes #8544 --- addons/stock_landed_costs/stock_landed_costs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock_landed_costs/stock_landed_costs.py b/addons/stock_landed_costs/stock_landed_costs.py index 1dad39ef1e9..1a879336e49 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -25,6 +25,7 @@ from openerp.exceptions import Warning from openerp.tools import float_compare, float_round from openerp.tools.translate import _ import product +from openerp import SUPERUSER_ID class stock_landed_cost(osv.osv): @@ -214,8 +215,7 @@ class stock_landed_cost(osv.osv): else: quant_dict[quant.id] += diff for key, value in quant_dict.items(): - print value - quant_obj.write(cr, uid, key, {'cost': value}, context=context) + quant_obj.write(cr, SUPERUSER_ID, key, {'cost': value}, context=context) qty_out = 0 for quant in line.move_id.quant_ids: if quant.location_id.usage != 'internal':