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.

0

How does specification of a XML View in v8 work?

By
Peter Nietz
on 6/3/15, 11:55 AM 807 views

I tried to reproduce this tutorial for my module with the same data structure:

specify_view_to_use_doc_v6  

Is this still the right way for Odoo V8 because only the view with priority 15 is shown in both menu entries?

Is there a difference if there is no form view but only a tree/list view?

THX.

The tutorial to specify the FORM view works so far for me, but if I change the view type to list instead of form only the view with the higher priority is shown. Is there a way to specify a list view, too?

Peter Nietz
on 6/9/15, 6:49 AM

Did it! - Had to add my custom view_modes to VIEW_TYPES in: /openerp/addons/base/ir/ir_actions.py Then just I used my custom_type as view_mode for ir.actions.act_window.view and it works like perfect.

Peter Nietz
on 6/11/15, 11:50 AM
1
John
On 6/5/15, 12:46 PM

To my knowledge, that is still applicable.  You did notice that the only difference in the two actions was specifying the view_id in the following line, correct?

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

and also in the "ir.ui.view" for the higher priority: field name="priority" eval="15"

Peter Nietz
on 6/8/15, 9:30 AM

Setting the eval to 15 makes client_form_view_2 a higher priority (the default view), but I thought you were saying that only the one with eval=15 was showing. Again, the only difference between the two actions are that client_form_action calls the default view and client_form_action1 specifies a view_id and that "overrides" the default view.

John
on 6/8/15, 11:51 AM

ok for the form view it works without priority, but for list graph gantt kanban its not working at all... how is it possible to use the "REF" for lists or even better for customized lists derived from list of the web module.

Peter Nietz
on 6/9/15, 9:19 AM

Peter,

As far as I know, without using the "views" option in some python code, you can only specify a single view_id or set the priority like you did originally to get the views you want by default.

Look at the answer here for an example of how to specify the views for all view types using python code:
http://stackoverflow.com/questions/27441230/why-isnt-my-act-window-with-views-definition-and-using-act-window-view-equival

So, you could call an action that specifies some python code which returns the list, graph, gantt, kanban, etc. views specified with the 'views' dictionary key.

Hope that helps!

John
on 6/9/15, 9:51 AM

I also just came across this:

https://answers.launchpad.net/openobject-server/+question/197559

I've never done it, but please try it and let me know if it works for you!

John
on 6/9/15, 10:39 AM

I also found the method with ir.actions.act_window.view and it all works with form,tree,kanban,graph but if I add list or custom_list to view_mode it tells me: ParseError: "Wrong value for ir.actions.act_window.view.view_mode: 'custom_list'" but in the normal ir.actions.act_window the view_mode custom_list works fine but not with a ref to a view_id.

Peter Nietz
on 6/10/15, 11:37 AM
Peter,

I'm sorry, but I've not used lists or custom_lists before, so I have no idea what it could be.

Maybe try looking at the postgres and see what the other view_modes look like?
 
~John Walsh



On Wednesday, June 10, 2015 11:37 AM, Peter Nietz <nietz-gmx.net@mail.odoo.com> wrote:


I also found the method with ir.actions.act_window.view and it all works with form,tree,kanban,graph but if I add list or custom_list to view_mode it tells me: ParseError: "Wrong value for ir.actions.act_window.view.view_mode: 'custom_list'" but in the normal ir.actions.act_window the view_mode custom_list works fine but not with a ref to a view_id.
--
Peter Nietz
Sent by Odoo Inc. using Odoo access your messages


John
on 6/10/15, 12:08 PM

Thx ... u put me on the right track ... just had to add custom_list to VIEW_TYPES in /openerp/addons/base/ir/ir_actions.py

Peter Nietz
on 6/11/15, 11:52 AM
Glad to hear it! Good luck!
 
~John Walsh




On Thursday, June 11, 2015 11:52 AM, Peter Nietz <nietz-gmx.net@mail.odoo.com> wrote:


Thx ... u put me on the right track ... just had to add custom_list to VIEW_TYPES in /openerp/addons/base/ir/ir_actions.py
--
Peter Nietz
Sent by Odoo Inc. using Odoo access your messages


John
on 6/12/15, 7:27 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: 6/3/15, 11:55 AM
Seen: 807 times
Last updated: 6/11/15, 11:50 AM