İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4390 Görünümler

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.

Avatar
Vazgeç
Üretici

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?

Üretici

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.

En İyi Yanıt

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"/> 
Avatar
Vazgeç
Üretici

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

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.

Üretici

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,

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!

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!

Üretici

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,

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


Üretici

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

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


İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Ağu 16
3082
1
Mar 15
3550
0
Mar 15
2597
2
Haz 23
2780
1
Haz 23
2580