Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
7 Risposte
29775 Visualizzazioni

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
Abbandona

How to create Action Menu in Odoo

Reference: https://goo.gl/UnHzS8

Risposta migliore

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
Abbandona

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).

Risposta migliore

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

Avatar
Abbandona
Risposta migliore

Hello Mario,

Without an action menu will not display.

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

Avatar
Abbandona

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>

Autore Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
5
ago 23
41794
0
ott 22
5057
0
dic 24
1017
1
set 21
8710
4
ott 19
33561