Skip to content
Snippets Groups Projects
Commit bdd5ec82 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] stock: reload after stock picking scrap

If a wizard is launched from an embedded view list, only the record of the line from which the wizard was launched is reloaded after closing the wizard.

In this specific case, as new lines are added to the picking, we need to fully reload the stock picking
parent bb913d0a
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,18 @@ class stock_move_scrap(osv.osv_memory):
move_obj.action_scrap(cr, uid, move_ids,
data.product_qty, data.location_id.id, restrict_lot_id=data.restrict_lot_id.id,
context=context)
return {'type': 'ir.actions.act_window_close'}
if context.get('active_id'):
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
return {
'view_type': 'form',
'view_mode': 'form',
'res_model': 'stock.picking',
'type': 'ir.actions.act_window',
'res_id': move.picking_id.id,
'context': context
}
else:
return {'type': 'ir.actions.act_window_close'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment