Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Guest House
    • Distributeur de boissons
    • Hotel
    Real Estate
    • Real Estate Agency
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consulting
    • Accounting Firm
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Solar Energy Systems
    • Cordonnier
    • Services de nettoyage
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Hide menu for existing group

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
xmlmenuaccess
13 Réponses
60866 Vues
Avatar
Alexander

How can I hide menu item for user group, using xml? I'm find code example, what grant access for some group:

<record id="original_module.menu_id" model="ir.ui.menu">
    <field name="groups_id" eval="[(4,ref('my_new_group_id'))]"/>
</record>

But, if user group already there, how can I remove it from there?

6
Avatar
Ignorer
Avatar
Omal Bastin
Meilleure réponse

you can use the following example

<record id="original_module.menu_id" model="ir.ui.menu">
    <field name="groups_id" eval="[(3,ref('my_new_group_id'))]"/>
</record>

There are actually0-6 numbers for representing each job for a many2many/ one2many field

  • (0, 0, { values }) -- link to a new record that needs to be created with the given values dictionary
  • (1, ID, { values }) -- update the linked record with id = ID (write values on it)
  • (2, ID) -- remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well)
  • (3, ID) -- cut the link to the linked record with id = ID (delete the relationship between the two objects but does not delete the target object itself)
  • (4, ID) -- link to existing record with id = ID (adds a relationship)
  • (5) -- unlink all (like using (3,ID) for all linked records)
  • (6, 0, [IDs]) -- replace the list of linked IDs (like using (5) then (4,ID) for each ID in the list of IDs)
31
Avatar
Ignorer
Alexander
Auteur

Thanks, it's works fine for me. May be you can explain what mean '4' and '3' numbers?

Omal Bastin

I have updated my answer. please check it as correct answer, if you feel its correct. Thank you

Alexander
Auteur

Thank you for your help. Where did you find this information?

Omal Bastin

I havent find any online documents. i found this in the orm file openerp addons

ARRIOUACH Mohamed

good work Omal. thanks! that help me a lot.

Pascal Tremblay

THANKS!

Vardan

For existing groups i can hide menu but for new group (group i created), i am unable to hide menu.

Ryan Tris

Thank you for the very clear and explicit answer!

Tarikol Islam

This is not working for me. I used 3 and 5 to unlink a user from a menu which is basically public to every one

Avatar
Haresh Kansara
Meilleure réponse

https://youtu.be/zHPtb1SR8Sk

0
Avatar
Ignorer
Avatar
Omi Harjani
Meilleure réponse
<record id="base.menu_base_partner" model="ir.ui.menu">    <field name="groups_id" eval="[(5,ref('base.group_hidden'))]"/></record><record id="account.menu_finance" model="ir.ui.menu">    <field name="groups_id" eval="[(5,ref('base.group_hidden'))]"/></record>	<menuitem icon="terp-account" id="account.menu_finance" name="Accounting" sequence="14" action="account.open_board_account" groups="base.group_hidden"/>			<menuitem icon="terp-partner"			            id="base.menu_base_partner" name="Sales"			            sequence="1" groups="base.group_hidden"/>	<menuitem id="sales_branch.menu_branch_sale_quotation" name="Sales" groups="base.group_sales_manager"/>
0
Avatar
Ignorer
Avatar
wilson zauma
Meilleure réponse

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>
    <record id="group_stock_user_moseltex" model="res.groups">
        <field name="name">Almacen_mosel usuario</field>
        <field name="category_id" ref="base.module_category_warehouse_management"/>
        <field name="implied_ids" eval="[(4, ref('stock.group_stock_user'))]"/>
    </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.

i try to use this code, i think that this hide the menu for the users but this is no work.

<field name="groups_id" eval="[(3, ref('group_stock_users_moseltex'))]"/>
0
Avatar
Ignorer
Avatar
Alcaline
Meilleure réponse

hi

I want to hide my menu in Human Resources? I used that groups but it didn't work? can anyone please help me how to solve this problem thanks in advance..

Here is my code:

     <menuitem name="Human Resources"
            id="menu_hr_root"
            groups="base.group_hr_manager,base.group_hr_user,base.group_user"
            sequence="90"/>
        <menuitem id="menu_hr_main" parent="menu_hr_root" name="Human Resources" sequence="0"/>
        <menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" groups="base.group_hr_manager" sequence="50"/>

0
Avatar
Ignorer
Avatar
bernscheinder
Meilleure réponse

Hi,

I've tried this example:

<record id="view_picking_out_form_stoking" model="ir.ui.view">
            <field name="name">stock.picking.form.stocking</field>
            <field name="model">stock.picking</field>
            <field name="inherit_id" ref="stock.view_picking_out_form"/>
            <field name="groups_id" eval="[(6,0,[ref('stoking.res_groups_fournisseur')])]"/>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <xpath expr="/form[@string='Delivery Orders']/group/group/field[@name='date']" position="attributes">
                    <attribute name="attrs">{'readonly':[('state','not in',['cancel'])]}</attribute>
                </xpath>
                <xpath expr="/form[@string='Delivery Orders']/group/group/field[@name='min_date']" position="attributes">
                       <attribute name="attrs">{'readonly':[('state','not in',['cancel'])]}</attribute>
                </xpath>  
                <xpath expr="/form[@string='Delivery Orders']/group/group/field[@name='address_id']" position="attributes">
                       <attribute name="attrs">{'readonly':[('state','not in',['cancel'])]}</attribute>
                </xpath>
                <xpath expr="/form[@string='Delivery Orders']/notebook/page[@string='Notes']/field[@name='note']" position="attributes">
                       <attribute name="attrs">{'readonly':[('state','not in',['cancel'])]}</attribute>
                </xpath>   
            </field>
       </record>

 

But all groups is in read only. My goal is that "res_groups_fournisseur" only is in readolny in these fields.

0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
how to manage acces to menu?
menu access
Avatar
Avatar
2
mai 22
2649
Create menu, treeview from _auto: False model
xml models menu
Avatar
Avatar
1
août 20
5855
Hide menu for user with 2 groups
menu access groups
Avatar
0
mai 19
3772
Menu item appears only for some users
menu access 6.1
Avatar
Avatar
1
sept. 17
8826
Access Rights and how to show Menu
menu access rights
Avatar
Avatar
1
juil. 16
9900
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now