From 3ddb446b3bbbaeab17d03900247481a501c7aaf9 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 8 Jun 2016 17:13:25 +0200 Subject: [FIX] crm, mail: Convert to opportunity in mail notification The button "Convert to opportunity" in the mail notifications sent when posting a message on an opportunity just coudln't work as it attempted to call the `convert_opportunity` method without one of its required method parameter. opw-680017 --- addons/mail/controllers/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/mail/controllers/main.py') diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index 74ffbc07ca9..784b26671c6 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -1,4 +1,5 @@ import base64 +import json from operator import itemgetter import psycopg2 import werkzeug @@ -187,7 +188,7 @@ class MailController(http.Controller): Model = request.env[model] try: record = Model.browse(int(res_id)).exists() - getattr(record, method)() + getattr(record, method)(**json.loads(kwargs.get('params', {}))) except: return self._redirect_to_messaging() return werkzeug.utils.redirect('/mail/view?%s' % url_encode({'model': model, 'res_id': res_id})) -- cgit v1.2.3