[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:
parent
6fbf8b108b
commit
b6d6d6167b
|
@ -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),
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<field eval=""Michel Lafont"" name="partner_name2"/>
|
||||
<field eval=""(726) 782-0636"" 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=""The Oil Company"" name="partner_name"/>
|
||||
<field eval=""(769) 703-274"" name="partner_phone"/>
|
||||
|
@ -31,7 +31,7 @@
|
|||
<field eval=""Luc Latour"" name="partner_name2"/>
|
||||
<field eval=""(392) 895-7917"" 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=""Le Club SARL"" name="partner_name"/>
|
||||
<field eval=""(956) 293-2595"" name="partner_phone"/>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<field eval=""Mike Gardner"" name="partner_name2"/>
|
||||
<field eval=""(820) 167-3208"" 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=""TheKompany"" name="partner_name"/>
|
||||
<field eval=""(079) 681-2139"" name="partner_phone"/>
|
||||
|
@ -61,7 +61,7 @@
|
|||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval=""(077) 582-4035"" 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=""The Gas Company"" name="partner_name"/>
|
||||
<field eval=""(514) 698-4118"" name="partner_phone"/>
|
||||
|
@ -76,7 +76,7 @@
|
|||
<field eval=""Sam Stone"" name="partner_name2"/>
|
||||
<field eval=""(333) 715-1450"" 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=""Stonage IT"" name="partner_name"/>
|
||||
<field eval=""(855) 924-4364"" name="partner_phone"/>
|
||||
|
@ -93,7 +93,7 @@
|
|||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval=""Benoit Mortier"" name="partner_name2"/>
|
||||
<field eval=""(468) 017-2684"" 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=""Opensides SPRL"" name="partner_name"/>
|
||||
<field eval=""(373) 907-1009"" name="partner_phone"/>
|
||||
|
@ -109,7 +109,7 @@
|
|||
<field name="section_id" ref="crm.section_sales_department"/>
|
||||
<field eval=""Will Smith"" name="partner_name2"/>
|
||||
<field eval=""(463) 014-1208"" 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=""Gardner Group"" name="partner_name"/>
|
||||
<field eval=""(282) 603-7489"" name="partner_phone"/>
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)]}" />
|
||||
|
|
|
@ -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 = {}
|
||||
|
|
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in New Issue