From 1ffbec0decdca472bc4fd9f70caf665a09d41482 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 8 Nov 2016 15:15:51 +0100 Subject: [PATCH] Make click2dial work in real life --- base_phone/controllers/main.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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