This question has been flagged
1 Reply
6645 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

Avatar
Discard
Best Answer

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)

Avatar
Discard
Author

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

Author

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?