Hi Forum.
the module most add some fields to product.product normal view. i coped the dir to /usr/lib/pymodules/python2.7/openerp/addons/sol_products
are the modules dos not shown in the module list. (installed Modules, apps)
__init__.py
import sol_product_fields
__openerp__.py
{
'name': 'Sol Product Fields',
'version': '1.0',
'category': 'Product',
'description': "This module will added some spacial fields to Products View Form, and remove the EAN13 Barcode",
'author': 'xxxx',
'website': '',
'depends': ['base'],
'demo': [],
'update_xml':['update.xml'],
'installable': True,
'auto_install': False,
'web': True,
'js': [],
'qweb' : [],
'images': [],
'css': [],
}
sol_product_fields.py
from openerp.osv import fields, osv
class product_product(osv.osv):
_inherit = "product.product"
_columns = {
'product_category' : fields.selection([('MCB','MCB'),('Switches','Switches'),('Recepticals','Recepticals')],'Pruduct Category'),
'corve_ka_rating' : fields.selection([('3kA','3kA'),('6kA','6kA')],'Corve kA Rating'),
'corve_Pole' : fields.selection([("Pole 1","P1"),("Pole 1+N","P1+N"),("Pole 2","P2"),("Pole 3","P3"),("Pole 4","P4")],'Pole'),
'corve_current' : fields.selection([('10A','10A'),('16A','16A'),('20A','20A'),('32A','32A'),('40A','40A'),('50A','50A'),('63A','63A')],'Current'),
'corve_hugh_code': fields.char('Corve Hugh Code ',size=32,required=True, help='Imput Hugh Code'),
}
product_product()
update.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="sol_product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="list_price" position="after">
<field name="product_category"/>
<field name="corve_Pole" attrs="{'invisible': [('product_category', '!=', 'MCB') ] }"/>
<field name="corve_current" attrs="{'invisible': [('product_category', '!=', 'MCB') ] }"/>
<field name="corve_ka_rating" attrs="{'invisible': [('product_category', '!=', 'MCB') ] }"/>
<field name="corve_hugh_code" attrs="{'invisible': [('product_category', '!=', 'MCB') ] }"/>
</field>
</field>
</record>
</data>
</openerp>