我创建一个自定义模块,并试图率先Opportunity.Now即时获取所有的线索和展示像IMG1转换。 但实际上我想显示象IMG2并就应该带我去simlar像IMG3 scrren在那里我可以有选择的引线转换为任何机会铅点击。 我的问题是关于在IMG1任何铅点击,有事先没有response.Thanks。 我的代码是
lead.py
from osv import osv
from osv import fields
class crm_lead(osv.osv):
_name = 'crm.lead'
_inherit = 'crm.lead'
_description = "adding fields to crm.lead"
_columns = {
'nitesh_lead': fields.char('Nitesh Lead',size=64),
'lead_source': fields.many2one('crm.lead.source','Lead Source'),
'lead_status': fields.many2one('crm.lead.status','Lead Status')
}
class res_partner_title(osv.osv):
_name = 'crm.lead.source'
_order = 'name'
_columns = {
'name': fields.char('Source', required=True, size=46, translate=True)
}
class res_partner_title(osv.osv):
_name = 'crm.lead.status'
_order = 'name'
_columns = {
'name': fields.char('Status', required=True, size=46, translate=True)
}
lead_view.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- ========================This is Form layout===============================-->
<record id="crm_case_tree_view_oppor_extended" model="ir.ui.view">
<field name="name">Opportunities Tree</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_tree_view_oppor" />
<field name="arch" type="xml">
<field name="planned_revenue" position="replace"/>
<field name="probability" position="replace"/>
</field>
</record>
<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="contact_name" position="replace"/>
<label for="contact_name" position="replace">
<br/>
</label>
<xpath expr="//label[@for='street']" position="before">
<field name="contact_name"/>
</xpath>
<xpath expr="//label[@for='section_id']" position="before">
<field name="lead_source"/>
<field name="lead_status"/>
</xpath>
<field name="function" position="replace"/>
<field name="partner_name" position="replace"/>
<field name="priority" position="replace"/>
<field name="categ_ids" position="replace"/>
<field name="partner_id" position="replace"/>
</field>
</record>
<!-- ===========================Action layout=========================== -->
<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,tree</field>
<field name="view_id" ref="crm_case_form_view_leads_extended"/>
</record>
<record id="show_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">tree</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_case_tree_view_oppor_extended"/>
</record>
<!-- ===========================Menu Settings=========================== -->
<menuitem name ="Lead" id = "menu_lead" />
<menuitem name="Leads" id="sub_menu_lead" parent="menu_lead" />
<menuitem name="Create Lead" id="create_lead" parent="sub_menu_lead" action="new_lead"/>
<menuitem name="Show Lead" id="show_leads" parent="sub_menu_lead" action="show_lead"/>
</data>
</openerp>