I'm trying to create a module to restrict access to Cost Price in the Procurement tab of the Product view. I want to let only Administrator and Purchase Manager see the Cost Price and make the other groups cannot see the Cost Price. I have created a module below. But It doesn't work. Nothing changes and everyone still can see the Cost Price. Can anybody tell me what my mistake is?
__init__.py
import product_template
__openerp__.py
{ "name": "Hide Cost Price from Some Groups", "version": "1.0.0", "author": "Budi Hartono", "depends": ["product"], "category": "", "description": """ Hide Cost Price from Some Groups. """, "website": "http://www.recoremedia.com", "data": [ "product_view.xml", ], "installable": True, "active": False, }
product_template.py
from openerp.osv import fields, osv from openerp.tools.translate import _ class product_template(osv.osv): _inherit = "product.template"
product_view.xml
<?xml version="1.0" encoding="utf-8"?> <openerp> <data> <record id="product_template_form_view_restricted" model="ir.ui.view"> <field name="name">product.template.common.form</field> <field name="model">product.template</field> <field name="inherit_id" ref="product.product_template_form_view"/> <field name="arch" type="xml"> <field name="standard_price" position="replace"> <field name="standard_price" groups="base.group_erp_manager,purchase.group_purchase_manager"/> </field> </field> </record> </data> </openerp>
Do you have installed the module stock_account?
Yes I have installed it. It is the "WMS Accounting" isn't it?