İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
2901 Görünümler

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
Vazgeç
Üretici En İyi Yanıt

@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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Oca 25
9202
0
Şub 20
1316
2
Eki 19
7354
1
Mar 19
8301
1
Nis 23
8236