[FIX] stock: Added condition to check locations for removing warning message coming on returning outgoing moves(case:575526)

bzr revid: pso@tinyerp.com-20120607130236-5jn4bmiv7t7ul1ne
This commit is contained in:
Xavier ALT 2012-06-07 18:32:36 +05:30 committed by pso (OpenERP)
parent ef7c1ab249
commit d05bb6c9d2
1 changed files with 6 additions and 1 deletions

View File

@ -123,7 +123,12 @@ class stock_return_picking(osv.osv_memory):
if m.state == 'done':
return_history[m.id] = 0
for rec in m.move_history_ids2:
return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
# only take into account 'product return' stock move
# (i.e move with exact opposite of ours:
# (location, dest location) = (dest location, location))
if rec.location_dest_id.id == m.location_id.id \
and rec.location_id.id == m.location_dest_id.id:
return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
return return_history
def create_returns(self, cr, uid, ids, context=None):