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 to hide a page for specific role?

By
Alejandro Perez Cosio
on 12/18/14, 5:23 AM 971 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.

Regards
Alejandro

0

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3883
| 5 3 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>
                </xpath>
            </field>
        </record>

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

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

1 follower(s)

Stats

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