[IMP]CRM: Create a meeting when schedule_meeting click
bzr revid: sbh@tinyerp.com-20100119135109-hns33nlk7duu6z8a
This commit is contained in:
@@ -133,6 +133,19 @@ class opportunity2meeting(wizard.interface):
|
||||
|
||||
def _makeMeeting(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
opportunity_case_obj = pool.get('crm.opportunity')
|
||||
meeting_case_obj = pool.get('crm.meeting')
|
||||
for opportunity in opportunity_case_obj.browse(cr, uid, data['ids']):
|
||||
new_meeting_id = meeting_case_obj.create(cr, uid, {
|
||||
'name': opportunity.name,
|
||||
'date': opportunity.date,
|
||||
'date_deadline': opportunity.date_deadline,
|
||||
})
|
||||
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
|
||||
vals = {}
|
||||
opportunity_case_obj.write(cr, uid, [opportunity.id], vals)
|
||||
opportunity_case_obj.case_cancel(cr, uid, [opportunity.id])
|
||||
meeting_case_obj.case_open(cr, uid, [new_meeting_id])
|
||||
data_obj = pool.get('ir.model.data')
|
||||
result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter')
|
||||
id = data_obj.read(cr, uid, result, ['res_id'])
|
||||
|
||||
@@ -194,6 +194,19 @@ class phonecall2meeting(wizard.interface):
|
||||
|
||||
def _makeMeeting(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
phonecall_case_obj = pool.get('crm.phonecall')
|
||||
meeting_case_obj = pool.get('crm.meeting')
|
||||
for phonecall in phonecall_case_obj.browse(cr, uid, data['ids']):
|
||||
new_meeting_id = meeting_case_obj.create(cr, uid, {
|
||||
'name': phonecall.name,
|
||||
'date': phonecall.date,
|
||||
'duration': phonecall.duration,
|
||||
})
|
||||
new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
|
||||
vals = {}
|
||||
phonecall_case_obj.write(cr, uid, [phonecall.id], vals)
|
||||
phonecall_case_obj.case_cancel(cr, uid, [phonecall.id])
|
||||
meeting_case_obj.case_open(cr, uid, [new_meeting_id])
|
||||
data_obj = pool.get('ir.model.data')
|
||||
result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter')
|
||||
id = data_obj.read(cr, uid, result, ['res_id'])
|
||||
|
||||
Reference in New Issue
Block a user