From 0a4db3c0d78abe39c9ac283d159040ea4af003a9 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 6 Feb 2017 13:05:06 +0100 Subject: [PATCH] [FIX] purchase: refresh on shipments action button When opening a purchase order shipments using the given smart button, and attempting a refresh, it leaded to a "record has been deleted" error, because the current `active_id` is a purchase.order id, while the `active_id` in the window action `action_picking_tree` context expects a picking type id. The purpose of using `action_picking_tree` was to use it as a template instead of having to create a full action dict, not to actually use it. By removing the id from the action dict, we prevent to re-use the action window `action_picking_tree` on refresh. opw-706933 --- addons/purchase/purchase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 2687b82c311..89e7e10b812 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -398,6 +398,7 @@ class PurchaseOrder(models.Model): result = action.read()[0] #override the context to get rid of the default filtering on picking type + result.pop('id', None) result['context'] = {} pick_ids = sum([order.picking_ids.ids for order in self], []) #choose the view_mode accordingly