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

Why new menuitem dissapear with a user?

By
Anabela Damas
on 12/17/13, 3:38 PM 1,803 views

Hi,

I create a new module that work well with admin user. When I create a new user the menuitem for my new user dissapear. Why?

My file ir.model.access.csv:

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_calculator_price,access_calculator_price,model_calculator_price,group_calculator_price,1,1,1,1

My file xx_security.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">

    <record model="ir.module.category" id="model_calculator_price">
        <field name="name">Folha de Cálculo</field>
        <field name="description">Something...</field>
        <field name="sequence">20</field>
    </record>

    <record model="res.groups" id="group_calculator_price">
        <field name="name">Manager</field>
        <field name="comment">Acesso Folha de Cálculo</field>
        <field name="category_id" ref="model_calculator_price"/>
    </record>


</data>

</openerp>

My file xml with view:

...
<menuitem id="menu_bionutrigal_calc" name="Test" groups="base.group_user"/>

<menuitem id="menu_bionutrigal_calc2" name="Calculator" parent="menu_bionutrigal_calc" groups="base.group_user" ></menuitem>

<menuitem action="action_calculator_price" string="Calculator Data" id="menu_bionutrigal_calc3" parent="menu_bionutrigal_calc2" groups="base.group_user"></menuitem>
....

My new user don't see the menu with name Test. With admin user is possible add the permission for my new user:

image description

But when the menuitem dissapear when I enter in openerp with this user.

(I've tested the first two answers, and nothing happened... So I add the text below)

Probably I've some error in the xx_security.xml file or in __openerp__.py.... Because when I run the openerp I always have this warning:

  WARNING testes_infinite openerp.modules.loading: The model calculator.price has no access rules, consider adding one. E.g. access_calculator_price,access_calculator_price,model_calculator_price,,1,1,1,1

My __openerp__.py :

....
    'init_xml': ['security/xx_security.xml',
                 'security/ir.model.access.csv'],
    'update_xml': ['vi_infinitechoice_sequence.xml',
                    ],
    'data': ['security/vi_infinitechoice_security.xml','security/ir.model.access.csv'],
.....

Anyone helps me please?

0
Anabela Damas
On 12/18/13, 11:16 AM

I don't know what the problem was, but the version that is working is this: xx_security.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="0">
        <record model="ir.module.category" id="module_category_group_calc_user">
            <field name="name">Calculation data</field>
            <field name="description">Something...</field>
            <field name="sequence">20</field>
        </record>
        <record model="res.groups" id="group_calc_user">
            <field name="name">User</field>
            <field name="comment">Access to calculation sheet.</field>
            <field name="category_id" ref="module_category_group_calc_user"/>
        </record>
    </data>

ir.model.access.csv

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
acess_infinitechoices_calc,calculator.price,model_calculator_price,group_calc_user,1,1,1,1

in view:

<menuitem id="menu_bionutrigal_calc" name="Bionutrigal" />

<!-- Menu Secundario - Menu Secundário-->
<menuitem id="menu_bionutrigal_calc2" name="Calculator" parent="menu_bionutrigal_calc" ></menuitem>

<!-- SubMenu com uma action que indica o que faz ao clicar no "Calculator Data" -->
<menuitem action="action_calculator_price" string="Calculator Data" id="menu_bionutrigal_calc3" parent="menu_bionutrigal_calc2" ></menuitem>

Thanks for the answers, know it's fixed. Don't know if it is the best solution. I have some problem with security in openerp =S

2
Jasad
On 12/18/13, 1:23 AM

Hi,

Better you remove the group in menu. Then it will be available to all users.

1

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 12/17/13, 3:50 PM

Go to Settings>Technical>Menu Items and look for your menu, then check if Human Resources / Employee is on Group Table, or you can assign other user.

This is because you have assigned the group "base.group_user" to your menu, this is the XML ID for the group "Human Resources / Employee". If you want to use the group permissions in your security file, change "base.group_user" to "MODULE_NAME.group_calculator_price"

Bista Solutions US, Ray Carnes
on 12/17/13, 5:43 PM

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

0 follower(s)

Stats

Asked: 12/17/13, 3:38 PM
Seen: 1803 times
Last updated: 3/16/15, 8:10 AM