diff --git a/base_phone/controllers/main.py b/base_phone/controllers/main.py index 0cde0bb..26a0517 100644 --- a/base_phone/controllers/main.py +++ b/base_phone/controllers/main.py @@ -23,11 +23,9 @@ from odoo import http class BasePhoneController(http.Controller): - @http.route('/base_phone/click2dial', type='json', auth='none') + @http.route('/base_phone/click2dial', type='json', auth='user') def click2dial(self, phone_number, click2dial_model, click2dial_id): - res = http.request.env['phone.common'].click2dial( - phone_number, { - 'click2dial_model': click2dial_model, - 'click2dial_id': click2dial_id, - }) + res = http.request.env['phone.common'].with_context( + click2dial_model=click2dial_model, + click2dial_id=click2dial_id).click2dial(phone_number) return res