odoo/addons/crm/test/phonecalls.yml

53 lines
1.7 KiB
YAML

-
I schedule a phone call with a customer.
-
!python {model: crm.phonecall2phonecall}: |
context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_phonecall_6")], 'active_id': ref("crm.crm_phonecall_6")})
res_id = self.create(cr, uid, {'name': "Proposition de réduction"}, context=context)
self.action_schedule(cr, uid, [res_id], context=context)
-
I schedule a meeting based on this phone call.
-
!python {model: crm.phonecall}: |
self.action_make_meeting(cr, uid, [ref("crm.crm_phonecall_6")])
-
I set the phone call to not held.
-
!python {model: crm.phonecall}: |
self.case_pending(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Not Held' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call held.}:
- state == "pending"
-
I cancel the phone call.
-
!python {model: crm.phonecall}: |
self.case_cancel(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Cancelled' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not cancelled.}:
- state == "cancel"
-
I reset the phone call.
-
!python {model: crm.phonecall}: |
self.case_reset(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is reset.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not reset.}:
- state == "open"
-
I set phone call to held (done).
-
!python {model: crm.phonecall}: |
self.case_close(cr, uid, [ref("crm.crm_phonecall_6")])
-
I check that the phone call is in 'Held' state.
-
!assert {model: crm.phonecall, id: crm.crm_phonecall_6, string: Phone call is not held.}:
- state == "done"