From d74a5ff57e9b394c9bbc60ab44fff6811f860412 Mon Sep 17 00:00:00 2001 From: "Purnendu Singh (OpenERP)" Date: Mon, 14 Oct 2013 19:13:56 +0530 Subject: [PATCH] [FIX] stock: use SUPERUSER_ID to create/copy quants bzr revid: psi@tinyerp.com-20131014134356-hm7cxryjnbgs2j14 --- addons/stock/stock.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9888092f708..a20f392c7fa 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -840,8 +840,8 @@ class stock_picking(osv.osv): for picking in self.browse(cr, uid, picking_ids, context=context): for move in picking.move_lines: ids_to_free += [quant.id for quant in move.reserved_quant_ids] - if ids_to_free: - quant_obj.write(cr, uid, ids_to_free, {'reservation_id' : False, 'reservation_op_id': False }, context = context) + if ids_to_free: + quant_obj.write(cr, SUPERUSER_ID, ids_to_free, {'reservation_id' : False, 'reservation_op_id': False }, context = context) def _reserve_quants_ops_move(self, cr, uid, ops, move, qty, create=False, context=None): """ @@ -867,7 +867,7 @@ class stock_picking(osv.osv): if quant[0]: #If quant can be reserved res_qty -= quant[1] quant_obj.quants_reserve(cr, uid, quants, move, context=context) - quant_obj.write(cr, uid, [x[0].id for x in quants if x[0]], {'reservation_op_id': ops.id}, context=context) + quant_obj.write(cr, SUPERUSER_ID, [x[0].id for x in quants if x[0]], {'reservation_op_id': ops.id}, context=context) return res_qty