[FIX] stock: use SUPERUSER_ID to create/copy quants
bzr revid: psi@tinyerp.com-20131014134356-hm7cxryjnbgs2j14
This commit is contained in:
parent
25c9549d31
commit
d74a5ff57e
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue