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

how to make button available only for specific group of users ?

S'inscrire

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

Cette question a été signalée
securityxmlgroupodooV8odoo8.0
4 Réponses
47619 Vues
Avatar
Ahmed Omar

i have a button and i want to make it available for specific users only

0
Avatar
Ignorer
Avatar
Waleed Ali Mohsen
Meilleure réponse

Hi Ahmed,

I prefer to create a group and add your users to it and then you can assign the group to your button in two ways:

 Using Odoo GUI:  

  •  Edit the view and then add groups attribute to your button as below:

    <button name="print_quotation" string="Print" type="object" states="draft" groups="YOUR GROUP" class="btn-primary"/>

Using XML: You will create your module and add a view to inherit your view and add groups attribute to your button and specify the created group.   

 You will use Xpath to determine the path of  the button and you can get it from the original view

Below is example to inherit "sale.view_order_form" view and then add groups attribute to "Print" button so the button will be shown for the added group only.

By the way: I added [1] to xpath cause the sales order form has 2 buttons with the same name "print_quotation" and the groups will be applied for the first one only.

<record model="ir.ui.view" id="show_button_sale_view_order_form">

<field name="model">sale.order</field>

<field name="inherit_id" ref="sale.view_order_form"/>

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

<xpath expr="//button[@name='print_quotation'][1]" position="attributes">

<attribute name="groups">YOUR GROUP HERE</attribute>

</xpath>

</field>

</record>

7
Avatar
Ignorer
Ankit H Gandhi(AHG)

Hello Waleed,

+1 from me

Your answer help full me.

Tri Nanda

This solution help me, the key is add index [1] or [2], etc.. if we have multiple button with same name.

this is the related question that I ask, I get help from your answer:
https://www.odoo.com/id_ID/forum/help-1/how-to-hide-button-for-specific-user-192858

Thanks,
Tri Nanda

dhivya.n@galileosolutionpartners.com

I want to hide the validate button in goods receipt, for my new user group. I put like this in Edit View. But it is not saving and not showing any error.
<button name="button_validate" invisible="state in ('draft', 'confirmed', 'done', 'cancel')" string="Validate" type="object" class="oe_highlight" groups="stock.group_stock_user,__export__.res_groups_222_2e337fae" data-hotkey="v"/>

Avatar
Sehrish
Meilleure réponse

There are different ways to visible/invisible buttons for a specific group of users.

The first way is to add group attribute in button element, its mean that show the button only specific groups of user.

<button name="button_name" string="You Button Name Goes Here"  type="object" class="oe_highlight" groups="group_name1,group_name2"/>

The other way is to show buttons to specific user dynamically (on the basis of some condition). To do so we use invisible property of "attr" attribute.

<button name="button_name" string="You Button Name Goes Here"  type="object" class="oe_highlight" attrs="{'invisible':[('state','!=','your_state_goes_here')]}"/>

Thanks

3
Avatar
Ignorer
Sehrish

Read more about invisible/visible fields, buttons etc in odoo: http://learnopenerp.blogspot.com/2016/10/how-to-visible-and-invisible-fields-in.html

Perform some action (Show/Hide fields, buttons etc) on the basis of login user group:

http://learnopenerp.blogspot.com/2017/10/how-to-check-login-user-group-in-odoo.html

Avatar
Lan Pham
Meilleure réponse

As in my case I want only the user who created the record can see the 'Confirm' button, I have to create a computed field to check if the logged in user is the record creator and put the field on the form view to check.

0
Avatar
Ignorer
Avatar
Usman Aldewan
Meilleure réponse

you can do without any coding, in development mode user groups in settings, click on user group and from access rights list you can manupulate buttons

-1
Avatar
Ignorer
dhivya.n@galileosolutionpartners.com

We can't give button access from here.

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 create user Group Application for your module? Résolu
security xml group
Avatar
Avatar
6
janv. 21
45817
[SOLVED] Is posible change a domain_force in security.xml through a function in Python? (odoo 8) Résolu
security domain xml odoo8.0
Avatar
Avatar
2
mars 15
10856
How to display alert on button onclick JS in odoo 8?
xml js python2.7 odooV8 odoo8.0
Avatar
Avatar
2
août 20
9344
How to fix a particular group "Group B" from res.groups in Odoov8 Résolu
xml python2.7 odooV8 odoo8.0 odoo 8
Avatar
Avatar
1
juil. 19
6270
Issue with new security groups Résolu
security menuitem groups odooV8 odoo8.0
Avatar
Avatar
Avatar
3
avr. 17
5249
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