I'm trying to add some restriction to procurement department, so i tried to add this code:
<xpath expr="//form[1]/sheet[1]/notebook[1]/page[@name='order_lines']/field[@name='order_line']/tree[1]/field[@name='price_unit']" position="attributes">
<attribute name="groups">Departments.PurchasingMarketing, Departments.PurchasingCoordinator</attribute>
</xpath>
<xpath expr="//form[1]/sheet[1]/notebook[1]/page[@name='order_lines']/field[@name='order_line']/tree[1]/field[@name='price_unit']" position="after">
<field name="price_unit" readonly="1" groups="Departments.SystemAdministrators,!Departments.Purchasing, !Departments.PurchasingCoordinator"/>
</xpath>
But THIS error code is preventing me to do it:
<form string="Sales Order" class="o_sale_order" __validate__="1"> <header> <field name="locked" invisible="1"/> Field 'price_unit' used in context ({ 'partner_id': parent.partner_id, 'quantity': product_uom_qty, 'pricelist': parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id, 'default_list_price': price_unit, 'default_description_sale': name }) is restricted to the group(s) Departments.PurchasingMarketing, Departments.PurchasingCoordinator,Departments.SystemAdministrators,!Departments.Purchasing,!Departments.PurchasingCoordinator.
What did i miss?
Check context inside product_id and product_template_id fields if it is prevent to inherit this field or not.
What is the error you get?
<form string="Sales Order" class="o_sale_order" __validate__="1"> <header> <field name="locked" invisible="1"/> Field 'price_unit' used in context ({ 'partner_id': parent.partner_id, 'quantity': product_uom_qty, 'pricelist': parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id, 'default_list_price': price_unit, 'default_description_sale': name }) is restricted to the group(s) Departments.PurchasingMarketing, Departments.PurchasingCoordinator,Departments.SystemAdministrators,!Departments.Purchasing,!Departments.PurchasingCoordinator.
This one.