purchase.order.form.inherit.subcontracting.inventory.move.first purchase.order Subcontracting Inventory Moves ir.actions.act_window stock.move list,form [('location_dest_id.name', '=', 'Subcontracting Location')] {'search_default_location_dest_id_name': 'Subcontracting Location'} Link to Purchase Order code if records: # Get the active purchase order from context po_id = env.context.get('default_purchase_order_id') or env.context.get('active_id') if po_id: po = env['purchase.order'].browse(po_id) for record in records: po.link_selected_subcontracting_move(record.id) # Close the wizard window action = {'type': 'ir.actions.act_window_close'}