48 lines
1.8 KiB
YAML
48 lines
1.8 KiB
YAML
-
|
|
I make direct opportunity for Customer.
|
|
-
|
|
!python {model: crm.partner2opportunity}: |
|
|
context.update({'active_model': 'res.partner', 'active_ids': [ref("base.res_partner_9")]})
|
|
res_id = self.create(cr, uid, {'name': "enquête pour l'achat de services"}, context=context)
|
|
self.make_opportunity(cr, uid, [res_id], context=context)
|
|
|
|
-
|
|
I make another opportunity from phonecall for same customer.
|
|
-
|
|
!python {model: crm.phonecall2opportunity}: |
|
|
context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")]})
|
|
res_id = self.create(cr, uid, {'name': "Quoi de prix de votre autre service?", 'partner_id': ref("base.res_partner_9")}, context=context)
|
|
self.make_opportunity(cr, uid, [res_id], context=context)
|
|
-
|
|
Now I merge all opportunities of customer.
|
|
-
|
|
!python {model: crm.lead}: |
|
|
opportunity_ids = self.search(cr, uid, [('partner_id','=', ref("base.res_partner_9"))])
|
|
self.merge_opportunity(cr, uid, opportunity_ids, context=context)
|
|
|
|
-
|
|
Now I schedule another phonecall to customer after merged.
|
|
-
|
|
!python {model: crm.phonecall2phonecall}: |
|
|
context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_case_phone06")]})
|
|
res_id = self.create(cr, uid, {'name': "vos chances sont fusionnés en un seul"}, context=context)
|
|
self.action_schedule(cr, uid, [res_id], context=context)
|
|
|
|
-
|
|
I schedule Meeting on this phonecall.
|
|
-
|
|
!python {model: crm.phonecall}: |
|
|
self.action_make_meeting(cr, uid, [ref("crm.crm_case_phone06")])
|
|
|
|
-
|
|
I setting Phone call to Held (Done).
|
|
-
|
|
!python {model: crm.phonecall}: |
|
|
self.case_close(cr, uid, [ref("crm.crm_case_phone06")])
|
|
-
|
|
I check that the hone call is in 'Held' state.
|
|
-
|
|
!assert {model: crm.phonecall, id: crm.crm_case_phone06, string: Phone call Helded}:
|
|
- state == "done"
|
|
|