From 661ff82af4baa8ef5464dcea49eeb1fc4855201b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 10 May 2013 16:14:59 +0200 Subject: [PATCH] [FIX] crm partner assign: consider all forward message as mass_mailing; this way the message will not have any subtype, therefore not sent to any follower; but partner_ids (aka, assigned partner) will receive it. bzr revid: tde@openerp.com-20130510141459-976io7ls9hllizvx --- .../crm_partner_assign/wizard/crm_forward_to_partner.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py index 91d462de015..924f96180cc 100644 --- a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py +++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py @@ -105,10 +105,17 @@ class crm_lead_forward_to_partner(osv.TransientModel): """ Forward the lead to a partner """ if context is None: context = {} + # TDE FIX in 7.0: force mass_mailing mode; this way, the message will be + # send only to partners; default subtype of mass_mailing is indeed False + # Chatter will show 'logged a note', but partner_ids (aka, the assigned partner) + # will effectively receive the message if present in the composition window + self.write(cr, uid, ids, {'composition_mode': 'mass_mail'}, context=context) res = {'type': 'ir.actions.act_window_close'} wizard = self.browse(cr, uid, ids[0], context=context) if wizard.model not in ('crm.lead'): return res + if context.get('active_ids') is None: + context['active_ids'] = [wizard.res_id] lead = self.pool[wizard.model] lead_ids = wizard.res_id and [wizard.res_id] or [] @@ -116,6 +123,7 @@ class crm_lead_forward_to_partner(osv.TransientModel): if wizard.composition_mode == 'mass_mail': lead_ids = context and context.get('active_ids', []) or [] value = self.default_get(cr, uid, ['body', 'email_to', 'email_cc', 'subject', 'history_mode'], context=context) + value.pop('composition_mode') self.write(cr, uid, ids, value, context=context) return self.send_mail(cr, uid, ids, context=context)