[FIX] stock: use SUPERUSER_ID to create/copy quants

bzr revid: psi@tinyerp.com-20131014134356-hm7cxryjnbgs2j14
This commit is contained in:
Purnendu Singh (OpenERP) 2013-10-14 19:13:56 +05:30
parent 25c9549d31
commit d74a5ff57e
1 changed files with 3 additions and 3 deletions

View File

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