Skip to Content
Menu
This question has been flagged
2 Replies
2070 Views

Hi All,

We have an Odoo 11 Application and we need to customize the Search view for Purchase-Vendors Window.

By default, the window had a filter “Vendor” and if we remove the search filter it will bring all data to that Window

We had tied to save like bookmark in “Favorites” but clearing the Filter, the window displays all  

So, we would like to know how it is possible to show only “Vendor” in the Purchase-Vendors Window even the end-user removes the search Filter.

Also, we need to write these configurations to our custom addons file which can be installed and shared when needed

Regards,

Avatar
Discard
Author Best Answer

@NiyasRaphy
It worked with the domain and many thanks for your assistance

<record id="base.action_partner_supplier_form" model="ir.actions.act_window">
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">res.partner</field>
    <field name="domain">[('supplier''=', True), ('parent_id''=', False)]</field>
</record>

Avatar
Discard
Best Answer

Hi,

If the issue that you are trying to resolve is of showing all data when the default filter is removed, what you can do is that, you can apply a domain for the corresponding menu action.


Sample:

<record id="action_inventory_line_tree" model="ir.actions.act_window">
<field name="name">Inventory Lines</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.inventory.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="stock_inventory_line_tree2"/>
<field name="domain">[('inventory_id', '=', active_id)]</field>
</record>

As it is an existing menu, you can inherit the action and add the necessary domain.


For inheriting an existing menu in odoo, see: How To Inherit Existing Actions in Odoo


Thanks

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 21
7629
0
Feb 20
1316
2
Oct 19
5795
1
Mar 19
6975
1
Apr 23
6641