Ir al contenido
Menú
Se marcó esta pregunta
4 Respuestas
5423 Vistas

Hello. With odoo studio, is it possible to create two or more list views for one model. For example a view with some fields (name, address, date of birth), and another view with other fields (email, phone).

Thanks a lot.

Avatar
Descartar
Mejor respuesta

I have been looking around the net for this for more then half a year; tried the comments in this blog but was always confronted with a vital piece of information that was missing. 

Watch this video that explains perfectly simple how to duplicate a view, link it to the menu item and then start to edit the view according to your wishes. All using studio and developer mode, no coding involved. 

Shout out to Kevin Zacki @ Odoo Buffalo




Update for using view inheritance.


For those non-developers out there, this is the way I solve this in Odoo online v15 without XML or dev skills:

Let's say I have a view A (standard Odoo view), and I want to create a new view B building on top of A.

To achieve the desired outcome where View B is modified based on View A without altering View A, you should select "Base View" in the "View Inheritance Mode" when using the Odoo configuration menu to duplicate the view.

Here's the correct process:

  1. Go to "Settings" in the main menu of Odoo.

  2. Under the "Technical" section, click on "Views" to access the view configuration.

  3. Locate View A in the list of views and click on it to open the view configuration form.

  4. In the form, click on the "Duplicate" button (or a similar option) to create a duplicate of View A.

  5. Modify the necessary details of the duplicated view, such as the name and any other attributes specific to View B.

  6. In the "View Inheritance Mode" field, select "Base View" from the dropdown menu.

By selecting "Base View" as the view inheritance mode, you indicate that View B is based on View A and any modifications made to View B will not alter View A.

  1. Save the changes.

Following these steps, you have created View B based on View A using the duplication feature in the Odoo configuration menu. The "Base View" inheritance mode ensures that any modifications made to View B will not affect View A.


 
 


Avatar
Descartar
Mejor respuesta

Hi,

You can go to the views menu under settings -> technical -> user interface -> views, and search for your view and click on duplicate button from the action.

Also you can refer this video to understand how multiple views are handled in odoo: https://www.youtube.com/watch?v=-2EAt9nN4o0

Thanks

Avatar
Descartar
Mejor respuesta

Hi Bernard: Yes. It's possible to do this. However, you need some technical knowledge since it involves defining the base structure of the views manually before you can customize them using Studio. 

The steps involved are as follows: 

1. Activate Developer mode.

2. For each custom view that you need, start with defining a new menu item through Studio.

3. Edit the menu item, then edit the action associated with it and add a new view in the "View Ref" field of the action. You can then access this view through the menu item and customize it using Studio.

Hope this helps.

EDIT:

To associate a custom form view with the custom list view do the following.

Go into the action associated with the custom menu item you created. There is a one2many field called "Views" at the bottom of the "General Settings" tab. First add the custom list view here. Then add a new line and create the custom form view. Now, when you access the custom menu item, it will open the custom list view first and then the custom form view when you click on one of the records.

Avatar
Descartar
Autor Mejor respuesta

Thanks a lot Paresh. I created a new list view. But now how can I create a new form view and associate it to the list view I created?

Avatar
Descartar

Hi Bernard: I have edited my previous answer and added more information about how to do this.

Autor

Yes, I dit it, it's ok! Thanks a lot Paresh

Autor

How can I now edit my created view? Button for edit it is disabled in my studio :-(