我创建了一个新的自定义模块,并继承了CRM-LEAD。 我想增加新的领域和隐藏现有fields.I不能做it.Can谁能告诉我怎么能做到这一点。 我的代码
__init__.py
:
import lead
__openerp__.py
:
{
'name': 'Lead Information',
'version': '0.1',
'category': 'Tools',
'description': """This module is Lead information.""",
'author': 'Nitesh',
'website': '',
'depends': ['crm'],
'init_xml': ['lead_view.xml'],
'update_xml': [],
'demo_xml': [],
'installable': True,
'active': True,
'application': True
}
lead.py
:
from osv import osv
from osv import fields
class crm_lead(osv.osv):
_name = 'bala.lead'
_inherit = 'crm.lead'
_description = "adding fields to crm.lead"
_coloumns = {
'nitesh_lead': fields.char('Nitesh Lead',size=64)
}
lead_view.xml
:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- ========================This is Form layout===============================-->
<record id="crm_case_form_view_leads_extended" model="ir.ui.view">
<field name="name">CRM - Leads Form</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_leads" />
<field name="arch" type="xml">
<field name="email_from" postion="replace"/>
<field name="partner_name" postion="after">
<field name="nitesh_lead"/>
</field>
</field>
</record>
<record id="new_lead" model="ir.actions.act_window">
<field name="name">Lead</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">crm.lead</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_case_form_view_leads_extended"/>
</record>
<!-- ===========================Menu Settings=========================== -->
<menuitem name ="Lead" id = "menu_lis_lab" action="new_lead"/>
</data>
</openerp>
任何人都可以请说我没我有什么错?