跳至内容
菜单
此问题已终结
1 回复
7660 查看

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?

相关帖文 回复 查看 活动
1
3月 15
6406
3
3月 15
6747
1
3月 15
8194
1
5月 25
961
1
3月 25
927