Skip to Content
Meniu
This question has been flagged
1 Reply
175 Vizualizări

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
Abandonează

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?

Autor

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

Best Answer

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
Abandonează
Autor

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 Replies Views Activity
0
mar. 15
2565
3
iul. 24
22032
3
iul. 23
31894
2
sept. 18
6596
0
apr. 16
2042