The following is an example for a link.
<act_window
id="action_picking_out"
name="Delivery Orders"
res_model="stock.picking"
src_model="sale.order"
domain="[('sale_id', '=', active_id), ('type', '=', 'out')]"
context="{
'form_view_ref': 'stock.view_picking_out_form',
'tree_view_ref': 'stock.view_picking_out_tree',
'search_view_ref': 'stock.view_picking_out_search'
}"
/>
The link is in Sale Order form view, it is specified in the src_model
attribute. It is a link to the corresponding Delivery Order and is specified in res_model
. You can add domain for the view which the link opens. Here clicking on the link will open only the delivery orders with sale_id
equals to the active_id
(id of the sale order from which you have clicked the link) and type equals to out
. Also the corresponding form view, tree view and search view for the target form should be specified in the context
. Here the code for the link is added in sale_view.xml file, similarly you can add the link in the xml file which defines partner views (inheriting the partner model and adding it in your custom module will be a good idea).