[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
This commit is contained in:
Ruchir Shukla 2015-09-16 11:17:23 +05:30 committed by Martin Trigaux
parent 516d723cd4
commit 61300ee7f1
1 changed files with 2 additions and 2 deletions

View File

@ -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':