diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 0afac95535d443b4e178b59e3d42a5a3421c3553..c49abd90a146b543e57cf5b4e3d41335e3e7ceb2 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -974,11 +974,12 @@ Update your business card, phone book, social media,... Send an email right now def _notification_get_recipient_groups(self, cr, uid, ids, message, recipients, context=None): res = super(crm_lead, self)._notification_get_recipient_groups(cr, uid, ids, message, recipients, context=context) + lead = self.browse(cr, uid, ids[0], context=context) + won_action = self._notification_link_helper(cr, uid, ids, 'method', context=context, method='case_mark_won') lost_action = self._notification_link_helper(cr, uid, ids, 'method', context=context, method='case_mark_lost') - convert_action = self._notification_link_helper(cr, uid, ids, 'method', context=context, method='convert_opportunity') + convert_action = self._notification_link_helper(cr, uid, ids, 'method', context=context, method='convert_opportunity', partner_id=lead.partner_id.id) - lead = self.browse(cr, uid, ids[0], context=context) if lead.type == 'lead': res['group_sale_salesman'] = { 'actions': [{'url': convert_action, 'title': 'Convert to opportunity'}] diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index 74ffbc07ca93be500df21895d7a13b8575dc4bdc..784b26671c653dfcdc350f378728b30289f83919 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})) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 7f30862be5f02dcb1a7683e5befa2931edd37db3..f0065dcd3caa054a027af6f35fcdc02cde28907b 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -4,6 +4,7 @@ import base64 import datetime import dateutil import email +import json import lxml from lxml import etree import logging @@ -560,7 +561,7 @@ class MailThread(models.AbstractModel): link = '/mail/workflow?%s' % url_encode(params) elif link_type == 'method': method = kwargs.pop('method') - params = dict(base_params, method=method, params=kwargs) + params = dict(base_params, method=method, params=json.dumps(kwargs)) link = '/mail/method?%s' % url_encode(params) elif link_type == 'new': params = dict(base_params, action_id=kwargs.get('action_id'))