Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
2839 Visualizzazioni

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
Abbandona
Autore Risposta migliore

@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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
gen 25
9068
0
feb 20
1316
2
ott 19
7218
1
mar 19
8179
1
apr 23
8115