Odoo Help


How to hide a page for specific role?

Alejandro Perez Cosio
on 12/18/14, 5:23 AM 1,722 views

Hello all,

I need to hide the procurement tab page at the product template form view for point_of_sale.group_pos_user role. Any other role should be able to see that page.



Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
| 5 5 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 12/18/14, 5:56 AM

Try this

        <record id="product_template_form_view_inherit_inherit"    model="ir.ui.view">
            <field name="name">product.template.form.inherit</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="product.product_template_form_view" />

            <field name="groups_id" eval="[(6, 0, [ref('point_of_sale.group_pos_user') ])]"/>
            <field name="arch" type="xml">
                <xpath expr="//page[@string='Procurements']" position="attributes">
                         <attribute name="invisible">True</attribute>

Note: (6, 0, ids) - replaces old groups and adds POS user group.  This is usually done when manipulating List values.

For more info check odoo 8 documentation.(https://www.odoo.com/documentation/8.0/reference/orm.html#model-reference) --Check at WRITE(vals)

Hello atchithan, thank you for your answer, but that will allow group_pos_user to see the procurement tab. I want the opposite: Hide procurement tab for group_pos_user

Alejandro Perez Cosio
on 12/18/14, 6:21 AM

please check now

Atchuthan - Technical Consultant, Sodexis Inc
on 12/18/14, 7:18 AM

Yes! it works! but for your response you should replace "Procurement" with "Procurements" and remove the True for the tag attribute. Thank you @atchuthan. Could you maybe make a fast explanation for the groups_id field? what does "[(6, 0, [ref('point_of_sale.group_pos_user') ])]" mean?

Alejandro Perez Cosio
on 12/18/14, 8:12 AM

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

1 follower(s)


Asked: 12/18/14, 5:23 AM
Seen: 1722 times
Last updated: 3/16/15, 8:10 AM