Fix unwanted opening of stock.picking when scrapping from production

This commit is contained in:
Nicolas Piganeau 2015-01-11 16:02:07 +01:00 committed by David Monjoie
parent d539be329e
commit accd3b472a
1 changed files with 10 additions and 10 deletions

View File

@ -88,16 +88,16 @@ class stock_move_scrap(osv.osv_memory):
context=context) context=context)
if context.get('active_id'): if context.get('active_id'):
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context) move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
return { if move.picking_id:
'view_type': 'form', return {
'view_mode': 'form', 'view_type': 'form',
'res_model': 'stock.picking', 'view_mode': 'form',
'type': 'ir.actions.act_window', 'res_model': 'stock.picking',
'res_id': move.picking_id.id, 'type': 'ir.actions.act_window',
'context': context 'res_id': move.picking_id.id,
} 'context': context
else: }
return {'type': 'ir.actions.act_window_close'} return {'type': 'ir.actions.act_window_close'}