Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hi Odoo developers,
I'm following the "Building a module" tutorial from Odoo webpage, and I was wondering if I can bind a window action to a first level menu in the sidebar, because I don't want to create a child menu to do this.
<record model="ir.actions.act_window" id="action_openacademy_list_courses">
<menuitem id="openacademy_menu_root" name="Open Academy" sequence="1"/>
<menuitem id="openacademy_menu_coursesroot" name="Course Management"
In the above source code, the "Course Management" menu is a first level menu in the sidebar, but although a window action is associated to it, I can't click in this menu to trigger the action. Is it possible to do this?.
not by default.
Except if you hack the default code here /addons/web/views/webclient_templates.xml
EDIT: a sample code
It just an idea/method... but you can do all what you want...
In this case, if we have only one children, we do the link on the top menu ...
(Patch here : http://pastesha.re/OjIF?diff)
<t t-foreach="menu['children']" t-as="menu">
+ <t t-set='current_menu' t-value="menu" />
- <t t-esc="menu['name']"/>
+ <t t-if="len(current_menu['children']) == 1">
+ <t t-set='menu' t-value="menu['children']" />
+ <t t-call="web.menu_link"/>
+ <t t-if="len(current_menu['children']) != 1">
+ <t t-esc="menu['name']"/>
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 platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/2/15, 8:18 AM|
|Seen: 543 times|
|Last updated: 5/3/15, 7:56 AM|