Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
7655 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

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

Автор

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?

Related Posts Відповіді Переглядів Дія
1
бер. 15
6403
3
бер. 15
6742
1
бер. 15
8186
1
трав. 25
950
1
бер. 25
925