summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2014-12-11 15:57:54 +0100
committerDenis Ledoux <dle@odoo.com>2014-12-11 15:59:13 +0100
commitbdd5ec8216d375ef2baf3e9903c394a8f13061a1 (patch)
treea7203ed210a58320a7b95896dc2d2023789b595d /addons
parentbb913d0a8f998781540d2456e9990f6a7bb67f34 (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/wizard/stock_move.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py
index f4027b4131e..7016494572d 100644
--- a/addons/stock/wizard/stock_move.py
+++ b/addons/stock/wizard/stock_move.py
@@ -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'}