Skip to Content
Menú
This question has been flagged
2 Respostes
2864 Vistes

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
Descartar
Autor 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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
2
de gen. 25
9124
0
de febr. 20
1316
2
d’oct. 19
7278
1
de març 19
8222
1
d’abr. 23
8176