Skip to Content
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
178 Näkymät

Hi everyone, 
I have a Many2one field, and when we select "Search More..", a list view opens for this field. Is it possible to directly open the list view for this Many2one field instead of choosing "Search More.."?

Avatar
Hylkää

Hi Katiyar Rustam,

Odoo does not provide the functionality to directly open the list view for a Many2one field without first selecting "Search More...". To achieve this, you would need to implement a custom solution, such as creating a custom widget or overriding existing behavior.

What do you want to achieve with a list view? When you select "Search More...", it also opens a list view in a popup. So what is your main requirement to directly open a tree view?

Tekijä

Hello Sudhir Arya,
when I click on the M2O fields, it will open a list view.

Paras vastaus

Yes, it is possible to directly open the list view for a Many2one field, but it requires creating a custom widget that alters the default behavior. By doing so, you can override the default functionality of theMany2one field, allowing it to open the list view directly when clicked, instead of requiring the user to select "Search More."

This custom widget would need to extend the existing Many2one widget in JavaScript and add functionality to automatically trigger the list view action upon interacting with the field.

Avatar
Hylkää
Tekijä

How do I create a custom widget? Are there any examples available?

You can explore existing Many2one widgets at Odoo Apps - https://apps.odoo.com/apps/modules/browse?search=many2one

By reviewing these pre-built widgets, you'll gain a better understanding of how to create a custom widget. You can then apply the necessary logic to open the list view directly.

Related Posts Vastaukset Näkymät Toimenpide
0
maalisk. 15
2566
3
heinäk. 24
22035
3
heinäk. 23
31905
2
syysk. 18
6600
0
huhtik. 16
2043