Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
5 Risposte
1865 Visualizzazioni

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
Abbandona

Did you added users in that group ?

Autore

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

Autore Risposta migliore

Solved. Sintaxt error:

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

Changed to

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




Avatar
Abbandona
Risposta migliore

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
Abbandona
Autore

Hi Anu,

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