Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
2886 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

@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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
led 25
9178
0
úno 20
1316
2
říj 19
7327
1
bře 19
8287
1
dub 23
8220