Skip to Content
Menu
This question has been flagged
5 Replies
1613 Views

I have create a securit group:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<record id="show_cost_price" model="res.groups">
<field name="name">show cost price</field>
</record>
</openerp>

And a view:

<record model="ir.ui.view" id="show_cost_price_form_product_template">
<field name="name">show_cost_price_form_product_template</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='standard_price']" position="attributes">
<attribute name="groups">hide_cost.show_cost_price"</attribute>
</xpath>
</field>
</record>

Odoo hide the label for all users ignoring the security group.


Avatar
Discard

Did you added users in that group ?

Author

Yes. The admin user. Other users are not in the group. None of the groups can view the label.

Author Best Answer

Solved. Sintaxt error:

<attribute name="groups">hide_cost.show_cost_price"</attribute>

Changed to

<attribute name="groups">hide_cost.show_cost_price</attribute>




Avatar
Discard
Best Answer

Hi,

  Just try  this if you are trying to hide the field label

<xpath expr="//label[@string='string_for_standard_price']" position="attributes">       
<attribute name="groups">hide_cost.show_cost_price"</attribute>
</xpath>
or you can hide that field for the  group by

<xpath expr="//field[@name='standard_price']" position="attributes">
<attribute name="groups">hide_cost.show_cost_price"</attribute>
</xpath>


                                                                                          

Avatar
Discard
Author

Hi Anu,

The problem it's the same. Hide label or filed for all users, ignoring the group permisions.