Skip to Content
This question has been flagged
1 Reply
85 Views

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
Discard

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?

Author

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
Discard
Author

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
2535
3
Jul 24
21912
3
Jul 23
31767
2
Sep 18
6502
0
Apr 16
2021