Odoo Help


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

Ahmed Omar
on 3/13/18, 10:36 AM 123 views

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

Waleed Mohsen
On 3/13/18, 3:32 PM

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>




About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 3/13/18, 10:36 AM
Seen: 123 times
Last updated: 3/14/18, 1:11 AM