From af36bda39f301a5303d00bb50b8082e9595edb40 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 25 Jun 2010 20:22:06 +0200 Subject: [PATCH] [FIX] crm: make default email_from consistent in crm wizards, plus some cleanup bzr revid: odo@openerp.com-20100625182206-r10xadycqsjtfjco --- addons/crm/wizard/crm_forward_to_partner.py | 6 +++--- addons/crm/wizard/crm_send_email.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/crm/wizard/crm_forward_to_partner.py b/addons/crm/wizard/crm_forward_to_partner.py index 700ac5fc5b1..aa742fe0276 100644 --- a/addons/crm/wizard/crm_forward_to_partner.py +++ b/addons/crm/wizard/crm_forward_to_partner.py @@ -282,12 +282,12 @@ class crm_lead_forward_to_partner(osv.osv_memory): defaults = super(crm_lead_forward_to_partner, self).default_get(cr, uid, fields, context=context) - active_ids = context.get('active_ids') - if not active_ids: + active_id = context.get('active_id') + if not active_id: return defaults lead_proxy = self.pool.get('crm.lead') - lead = lead_proxy.browse(cr, uid, active_ids[0], context=context) + lead = lead_proxy.browse(cr, uid, active_id, context=context) message = self._get_case_history(cr, uid, defaults.get('history'), lead.id, context=context) defaults.update({ diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py index 1a552ae7d20..d790d9b7a0a 100644 --- a/addons/crm/wizard/crm_send_email.py +++ b/addons/crm/wizard/crm_send_email.py @@ -172,7 +172,7 @@ class crm_send_new_email(osv.osv_memory): if 'email_to' in fields: res.update({'email_to': case.email_from}) if 'email_from' in fields: - res.update({'email_from': case.section_id and case.section_id.reply_to or user_mail_from}) + res.update({'email_from': user_mail_from}) if 'subject' in fields: res.update({'subject': str(context.get('subject', case.name) or '')}) if 'email_cc' in fields: @@ -209,7 +209,7 @@ class crm_send_new_email(osv.osv_memory): if 'email_to' in fields: res.update({'email_to': case.email_from or hist.email_from or False}) if 'email_from' in fields: - res.update({'email_from': case.section_id and case.section_id.reply_to or user_mail_from}) + res.update({'email_from': user_mail_from}) signature = '\n' + (case.user_id.signature or '') original = [signature]