[IMP] crm: add the phonecall_id and opportunity_id in meeting and remove the lead_category data

bzr revid: sbh@tinyerp.com-20100129100759-iudc6wsbr4n7zube
This commit is contained in:
sbh (Open ERP) 2010-01-29 15:37:59 +05:30
parent 6fbf8b108b
commit b6d6d6167b
9 changed files with 26 additions and 49 deletions

View File

@ -46,7 +46,7 @@ class crm_lead(osv.osv):
_order = "id desc"
_inherit = 'crm.case'
_columns = {
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Lead Type Name', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"),
'partner_name': fields.char("Employee's Name", size=64),
'partner_name2': fields.char('Employee Email', size=64),

View File

@ -2,42 +2,7 @@
<openerp>
<data noupdate="1">
<record model="crm.case.categ" id="categ_lead1">
<field name="name">Existing Customer</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_lead2">
<field name="name">Self Generated</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_lead3">
<field name="name">Employee</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_lead4">
<field name="name">Partner</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_lead6">
<field name="name">Website</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_lead7">
<field name="name">Word of mouth</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="categ_lead8">
<field name="name">Other</field>
<field name="section_id" ref="section_sales_department"/>
<field name="object_id" search="[('model','=','crm.lead')]" model="ir.model"/>
</record>
<!-- CASE STATUS(stage_id) -->
<record model="crm.case.stage" id="stage_lead1">
<field name="name">New</field>

View File

@ -16,7 +16,7 @@
<field eval="&quot;Michel Lafont&quot;" name="partner_name2"/>
<field eval="&quot;(726) 782-0636&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_lead6"/>
<field name="categ_id" ref="crm.categ_oppor6"/>
<field name="stage_id" ref="crm.stage_lead1"/>
<field eval="&quot;The Oil Company&quot;" name="partner_name"/>
<field eval="&quot;(769) 703-274&quot;" name="partner_phone"/>
@ -31,7 +31,7 @@
<field eval="&quot;Luc Latour&quot;" name="partner_name2"/>
<field eval="&quot;(392) 895-7917&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_lead2"/>
<field name="categ_id" ref="crm.categ_oppor2"/>
<field name="stage_id" ref="crm.stage_lead2"/>
<field eval="&quot;Le Club SARL&quot;" name="partner_name"/>
<field eval="&quot;(956) 293-2595&quot;" name="partner_phone"/>
@ -46,7 +46,7 @@
<field eval="&quot;Mike Gardner&quot;" name="partner_name2"/>
<field eval="&quot;(820) 167-3208&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_lead4"/>
<field name="categ_id" ref="crm.categ_oppor4"/>
<field name="stage_id" ref="crm.stage_lead4"/>
<field eval="&quot;TheKompany&quot;" name="partner_name"/>
<field eval="&quot;(079) 681-2139&quot;" name="partner_phone"/>
@ -61,7 +61,7 @@
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="&quot;(077) 582-4035&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_lead1"/>
<field name="categ_id" ref="crm.categ_oppor1"/>
<field name="stage_id" ref="crm.stage_lead1"/>
<field eval="&quot;The Gas Company&quot;" name="partner_name"/>
<field eval="&quot;(514) 698-4118&quot;" name="partner_phone"/>
@ -76,7 +76,7 @@
<field eval="&quot;Sam Stone&quot;" name="partner_name2"/>
<field eval="&quot;(333) 715-1450&quot;" name="partner_mobile"/>
<field eval="1" name="active"/>
<field name="categ_id" ref="crm.categ_lead6"/>
<field name="categ_id" ref="crm.categ_oppor6"/>
<field name="stage_id" ref="crm.stage_lead3"/>
<field eval="&quot;Stonage IT&quot;" name="partner_name"/>
<field eval="&quot;(855) 924-4364&quot;" name="partner_phone"/>
@ -93,7 +93,7 @@
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="&quot;Benoit Mortier&quot;" name="partner_name2"/>
<field eval="&quot;(468) 017-2684&quot;" name="partner_mobile"/>
<field name="categ_id" ref="crm.categ_lead8"/>
<field name="categ_id" ref="crm.categ_oppor8"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="&quot;Opensides SPRL&quot;" name="partner_name"/>
<field eval="&quot;(373) 907-1009&quot;" name="partner_phone"/>
@ -109,7 +109,7 @@
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="&quot;Will Smith&quot;" name="partner_name2"/>
<field eval="&quot;(463) 014-1208&quot;" name="partner_mobile"/>
<field name="categ_id" ref="crm.categ_lead4"/>
<field name="categ_id" ref="crm.categ_oppor4"/>
<field name="stage_id" ref="crm.stage_lead4"/>
<field eval="&quot;Gardner Group&quot;" name="partner_name"/>
<field eval="&quot;(282) 603-7489&quot;" name="partner_phone"/>

View File

@ -22,6 +22,12 @@
from osv import fields, osv
import crm
class crm_opportunity(osv.osv):
_name = 'crm.opportunity'
crm_opportunity()
class crm_phonecall(osv.osv):
_name = 'crm.phonecall'
crm_phonecall()
class crm_meeting(osv.osv):
_name = 'crm.meeting'
_description = "Meeting Cases"
@ -36,6 +42,8 @@ class crm_meeting(osv.osv):
help='Category related to the section.Subdivide the CRM cases \
independently or section-wise.'),
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel', 'event_id', 'attendee_id', 'Attendees'),
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
'opportunity_id':fields.many2one ('crm.opportunity', 'Opportunity'),
}
crm_meeting()

View File

@ -47,6 +47,8 @@
attrs="{'readonly': [('rrule_type','!=','custom')]}"
/>
</group>
<field name="phonecall_id"/>
<field name="opportunity_id"/>
</group>
<notebook colspan="4">
<page string="Description">

View File

@ -56,6 +56,7 @@ class crm_opportunity(osv.osv):
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'date_closed': fields.datetime('Closed', readonly=True),
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
}
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
if not categ:

View File

@ -52,8 +52,9 @@
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
</group>
<field name="date_deadline" string="Deadline"/>
<field name="date" />
<group colspan="2">
<field name="date" />
<field name="phonecall_id" />
</group>
<button string="Schedule a Phone Call"
name="%(wizard_crm_opportunity_reschedule_phone_call)d" icon="gtk-redo" type="action" attrs="{'invisible':[('phonecall_id','!=',False)]}" />

View File

@ -141,6 +141,7 @@ class opportunity2meeting(wizard.interface):
'section_id' : opportunity.section_id and opportunity.section_id.id or False,
'date_deadline': opportunity.date_deadline,
'description':opportunity.description,
'opportunity_id':opportunity.id
})
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
vals = {}

View File

@ -104,15 +104,13 @@ class phonecall2opportunity(wizard.interface):
'probability': data['form']['probability'],
'partner_id': data['form']['partner_id'],
'section_id':phonecall.section_id.id,
'description':phonecall.description,
'description':phonecall.description,
'phonecall_id': phonecall.id
})
new_opportunity = opportunity_case_obj.browse(cr, uid, new_opportunity_id)
vals = {
'partner_id': data['form']['partner_id'],
}
if not phonecall.opportunity_id:
vals.update({'opportunity_id' : new_opportunity.id})
phonecall_case_obj.write(cr, uid, [phonecall.id], vals)
phonecall_case_obj.case_cancel(cr, uid, [phonecall.id])
opportunity_case_obj.case_open(cr, uid, [new_opportunity_id])
value = {
@ -202,6 +200,7 @@ class phonecall2meeting(wizard.interface):
'section_id' : phonecall.section_id and phonecall.section_id.id or False,
'duration': phonecall.duration,
'description':phonecall.description,
'phonecall_id':phonecall.id
})
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
vals = {}