Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Several views for one object?

By
Stephane
on 7/23/13, 1:11 PM 1,963 views

Hi,

how can I make 2 views for the same object? Which are displayed depending on the place I am?

For example I have one tree view which is available from 2 menus. Depending on this menu, I have a context={'management': True} or False in the action XML.

But these two menus opens the same tree, and I want to show the form view (object view) differently depending on this context.

Can someone help me? Thanks!

0

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 7/23/13, 2:08 PM

First you have to assign different priorities on the xml for your tree views

<record id="custom_form_tree" model="ir.ui.view">
        <field name="model">custom.model</field>
        <field eval="4" name="priority"/>
        <field name="arch" type="xml">

And on your action you have to set the tree view

<field name="view_id" ref="custom_form_tree"/>

This is going to work.

thank you, but in fact the tree view is not the problem, it's when I want to open the form view from the tree view (by clicking a row), So I want to make the form view different depending on which tree view I am... Sorry if I did not explain well

Stephane
on 7/24/13, 4:39 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/23/13, 1:11 PM
Seen: 1963 times
Last updated: 3/16/15, 8:10 AM