[FIX] Take case product in ops exist, but not in move
bzr revid: jco@openerp.com-20140306160106-ydz47uoh66d1nbip
This commit is contained in:
parent
e75cb3135c
commit
428d5e1af1
|
@ -3556,14 +3556,15 @@ class stock_pack_operation(osv.osv):
|
|||
def recompute_rem_qty_from_operation(self, cr, uid, op_ids, context=None):
|
||||
def _create_link_for_product(product_id, qty):
|
||||
qty_to_assign = qty
|
||||
for move in prod_move[product_id]:
|
||||
qty_on_link = min(qty_move_rem[move.id], qty_to_assign)
|
||||
cr.execute("""insert into stock_move_operation_link (move_id, operation_id, qty) values
|
||||
(%s, %s, %s)""", (move.id, op.id, qty_on_link,))
|
||||
qty_move_rem[move.id] -= qty_on_link
|
||||
qty_to_assign -= qty_on_link
|
||||
if qty_to_assign <= 0:
|
||||
break
|
||||
if prod_move.get(product_id):
|
||||
for move in prod_move[product_id]:
|
||||
qty_on_link = min(qty_move_rem[move.id], qty_to_assign)
|
||||
cr.execute("""insert into stock_move_operation_link (move_id, operation_id, qty) values
|
||||
(%s, %s, %s)""", (move.id, op.id, qty_on_link,))
|
||||
qty_move_rem[move.id] -= qty_on_link
|
||||
qty_to_assign -= qty_on_link
|
||||
if qty_to_assign <= 0:
|
||||
break
|
||||
return qty_to_assign == 0
|
||||
|
||||
def _check_quants_reserved(ops):
|
||||
|
|
|
@ -48,8 +48,9 @@ class stock_history(osv.osv):
|
|||
if '__domain' in line:
|
||||
lines = self.search(cr, uid, line['__domain'], context=context)
|
||||
inv_value = 0.0
|
||||
for line2 in self.browse(cr, uid, lines, context=context):
|
||||
inv_value += line2.inventory_value
|
||||
lines2 = self._get_inventory_value(cr, uid, lines, "", [], context)
|
||||
for line2 in lines2.keys():
|
||||
inv_value += lines2[line2]
|
||||
line['inventory_value'] = inv_value
|
||||
return res
|
||||
|
||||
|
|
Loading…
Reference in New Issue