Reputation: 101
I have created new action window in odoo12:
<record id="action_sales_line" model="ir.actions.act_window">
<field name="name">Searching</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line</field>
<field name="view_mode">tree</field>
<field name="domain">[('order_id', '=', ???)]</field>
<field name="target">new</field>
</record>
which display all records of sale order line as a wizard in sale module. What I want to do here is to have search view in that wizard and also domain must filter the result of a selected specific order i.e SO001, SO002 and have to be dynamic. So How to do that?
Upvotes: 0
Views: 1469
Reputation: 348
For filter selected sale order id you have to pass active_id in the domain. Like the following:
<record id="action_sales_line" model="ir.actions.act_window">
<field name="name">Searching</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order.line</field>
<field name="view_mode">tree</field>
<field name="domain">[('order_id', '=', active_id)]</field>
<field name="target">new</field>
</record>
I hope this helps you. Thank you.
Upvotes: 1