[FIX] scrap moves
bzr revid: qdp-launchpad@openerp.com-20130807111358-3lsceekxczxup8ov
This commit is contained in:
parent
e7dbdc2058
commit
6cdf121d50
|
@ -1396,7 +1396,7 @@ class stock_move(osv.osv):
|
|||
uos_qty = quantity / move_qty * move.product_uos_qty
|
||||
default_val = {
|
||||
'location_id': source_location.id,
|
||||
'product_qty': quantity,
|
||||
'product_uom_qty': quantity,
|
||||
'product_uos_qty': uos_qty,
|
||||
'state': move.state,
|
||||
'scrapped': True,
|
||||
|
|
|
@ -103,7 +103,7 @@ class stock_move_scrap(osv.osv_memory):
|
|||
res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
|
||||
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
|
||||
location_obj = self.pool.get('stock.location')
|
||||
scrpaed_location_ids = location_obj.search(cr, uid, [('scrap_location','=',True)])
|
||||
scrap_location_id = location_obj.search(cr, uid, [('scrap_location','=',True)])
|
||||
|
||||
if 'product_id' in fields:
|
||||
res.update({'product_id': move.product_id.id})
|
||||
|
@ -112,8 +112,8 @@ class stock_move_scrap(osv.osv_memory):
|
|||
if 'product_qty' in fields:
|
||||
res.update({'product_qty': move.product_qty})
|
||||
if 'location_id' in fields:
|
||||
if scrpaed_location_ids:
|
||||
res.update({'location_id': scrpaed_location_ids[0]})
|
||||
if scrap_location_id:
|
||||
res.update({'location_id': scrap_location_id[0]})
|
||||
else:
|
||||
res.update({'location_id': False})
|
||||
|
||||
|
|
Loading…
Reference in New Issue