Skip to Content
Menu
This question has been flagged
7 Replies
27275 Views

Hi guys, I've been trying new odoo12, and everything seems fine and nice to me. 
While trying it out, I was following tutorial for building up modules. eg Openacademy.
I have created those basic models, and  views for them, added them to the __manifest__.py file and double checked their paths. 
In my openacademy.xml file i have a line that says:

<menuitem id="main_openacademy_menu" name="Open Academy" sequence="75" groups="base.group_user"/>

his should be enough for the menu item to appear in main menu, but it does not. After this I added to dependencies 'hr' module, and run update.It installed the hr module, and 'Employee' menu item appeared in main menu...

I also tried adding it with (in order to follow naming convention I found in predefined modules/apps):

<menuitem id="menu_openacademy_root" name="Open Academy" sequence="75" groups="base.group_user"/>


I checked in postgresql, my models are properly created in the database

Odoo12 recognizes views I have declared in my "views/" directory. I can find them in Settings->Technical->User Interface -> Menu Items.

Does anyone else have similar experience with new Odoo12?


Avatar
Discard

How to create Action Menu in Odoo

Reference: https://goo.gl/UnHzS8

Best Answer

EDIT: After looking around further, it appears to be an issue with the security. Once the security file is properly updated and groups are assigned to the views, it will appear in the menu. I am not sure why going through the tutorial does not work properly for permissions. SOLUTION-In developer mode, Settings>Technical>Access Rules. Create a new access rule for Open Academy. You will have to create for all of the objects. Save and reload the page. Openacademy should now appear in the Menu. This needs to be clarified on the documentation page and corrected so the security.csv actually adds to the access rules list when the module is added/upgraded.

More info: \https://www.odoo.com/forum/help-1/question/create-module-on-odoo-12-won-t-to-show-link-to-access-141195


Original: I'm running into the same issue. I've done this without issues for version 10 and 11. Not sure what has suddenly changed. Their tutorial, and even using the default 'scaffold' code does not allow a custom module to appear on the main menu.

The menu does not appear, even if you have an action in place and the action is correct. There is no error output, it just doesn't appear.

Avatar
Discard

Side note: The security.xml MUST be before the ir.model.access.csv or it will give errors since it cannot find the group it is looking for. Also make sure that both are uncommented on __manifest__.py so they will load (remove the # if there is one).

Best Answer

you most has action in your menu or child menu that has action
other ways the menu will not display

Avatar
Discard
Best Answer

Hello Mario,

Without an action menu will not display.

Add any sub menu with an action under the root menu, it will work.

Avatar
Discard

Here is what my xml looks like, with the action provided and nothing shows up in the menu:

<?xml version="1.0" encoding="UTF-8"?>

<odoo>

<reco

rd model="ir.ui.view" id="course_form_view">

<field name="name">course.form</field>

<field name="model">openacademy.course</field>

<field name="arch" type="xml">

<form string="Course Form">

<sheet>

<group>

<field name="name"/>

<field name="description"/>

</group>

</sheet>

</form>

</field>

</record>

<!-- window action -->

<!--

The following tag is an action definition for a "window action",

that is an action opening a view or a set of views

-->

<record model="ir.actions.act_window" id="course_list_action">

<field name="name">Courses</field>

<field name="res_model">openacademy.course</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form</field>

<field name="help" type="html">

<p class="oe_view_nocontent_smiling_face">Create the first course

</p>

</field>

</record>

<!-- top level menu: no parent -->

<menuitem id="main_openacademy_menu" name="Open Academy"/>

<!-- A first level in the left side menu is needed

before using action= attribute -->

<menuitem id="openacademy_menu" name="Open Academy"

parent="main_openacademy_menu"/>

<!-- the following menuitem should appear *after*

its parent openacademy_menu and *after* its

action course_list_action -->

<menuitem id="courses_menu" name="Courses" parent="openacademy_menu"

action="course_list_action"/>

<!-- Full id location:

action="openacademy.course_list_action"

It is not required when it is the same module -->

</odoo>

Author Best Answer

They have changed admin default access rights. If you create new module without explicitly declaring that a user can access module, it will not be visible. 
Thanks @Gregory

Avatar
Discard
Related Posts Replies Views Activity
5
Aug 23
37848
0
Oct 22
3156
0
Dec 24
36
1
Sep 21
7434
4
Oct 19
31646