Override window action context with button context in Odoo

Viewed 969

I have a button defined in an odoo view like this:

<field name="x_stock_picking_type_id" invisible="1"/>
<button type="action" name="449" string="Process Orders" class="btn btn-primary" context="{'search_default_picking_type_id': x_stock_picking_type_id, 'search_default_x_stock_picking_group_id': active_id}"/>

Window action 449 is in the database and is defined with the following context value:

{'search_default_picking_type_id': [active_id], 'default_picking_type_id': active_id, 'contact_display': 'partner_address', 'search_default_available': 1,}

My hope was that by passing in the search_default_picking_type_id key on the button context, that it would override the context defined in the window action. The Odoo documentation says that button context is:

merged into the view's context when performing the button's Odoo call

When I click the button however, the resulting view seems to still use the context defined on the window action. It's using active_id for the value of search_default_picking_type_id rather than x_stock_picking_type_id.

Is this intended, or a bug? Should a key on the button context override the same key in the window action context?

0 Answers
Related