[FIX] crm: make default email_from consistent in crm wizards, plus some cleanup

bzr revid: odo@openerp.com-20100625182206-r10xadycqsjtfjco
This commit is contained in:
Olivier Dony
2010-06-25 20:22:06 +02:00
parent 1c056da2e1
commit af36bda39f
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -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({
+2 -2
View File
@@ -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]