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

how can hide a menu for one group specific user?

By
wilson zauma
on 3/13/14, 2:55 PM 2,394 views

i like to hide a menu for one group specifity, but when i apply delete this remove all menu for all users, but i want to hide for one groups. explain: i inherit a groups to user from warehouse, but this specifity users i dont want to show menu stock out.

for example i create a new groups users. i define in MY_module_folder/security/my_security.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
 <data noupdate="0">
    <record id="group_stock_manager_moseltex" model="res.groups">
        <field name="name">Almacen_mosel Encargado</field>
       <field name="implied_ids" eval="[(4, ref('stock.group_stock_manager'))]"/>
    </record>
 </data>
</openerp>

but i want to hide a menu stock out (this code put inside the my_security.xml).

 `<record model="ir.ui.menu" id="menu_action_picking_tree">
 <field name="groups_id"  eval="[ref('group_stock_manager_moseltex')]" />`

but this is dont work.

Did you solve this problem?

Pascal Tremblay
on 2/19/15, 7:36 PM
1
Mansi Kariya (mka)
On 2/20/15, 12:16 AM

Hello,

Try this,

<record model="ir.ui.menu" id="stock.menu_action_picking_tree">

<field name="groups_id" eval="[(4, ref('group_stock_manager_moseltex'))]"/>

</record>

you have to give reference of module associated with that menu. and menu_action_picking_tree belongs to stock module in odoo 7.0 Here 4 will add group to existing list of groups on that menu. If you want to replace existing groups on that menu than use 6 instead. example- (6,0,[ref('group_stock_manager_moseltex')].

There are six numeric commands:

  • 0 - creates a new object and adds it to the Many2many relation
  • 1 - updates an object that already exists on the relation
  • 2 - deletes an object that already exists on the relation
  • 3 - removes an existing object from the relation, without deleting it
  • 4 - adds an existing object to the relation
  • 5 - removes all objects from the relation, without deleting them
  • 6 - replaces pervious objects existing on the relation with a new set of objects

Hope this will help you.

0
Jordan Vrtanoski
On 2/19/15, 11:34 PM

The access to the menu item is granted, not revoked. You need to create a group of users that have access to the menu item. To do this, you should modify the meny item's attribute groups and add the list of groups that have access Here is a sample:

        <menuitem name="Registrations"
            id="menu_action_registration" parent="base.menu_event_main"
            action="action_registration" groups="event.group_event_manager,event.group_event_user"/>

Same logic works for the elements in the odoo view (field, page, div, etc.)

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

2 follower(s)

Stats

Asked: 3/13/14, 2:55 PM
Seen: 2394 times
Last updated: 3/16/15, 8:10 AM