[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
This commit is contained in:
Denis Ledoux
2017-02-06 13:08:45 +01:00
parent 9dc96091f3
commit 0a4db3c0d7
+1
View File
@@ -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