[FIX] crm: Add the include_original flag in the context, to allows to include the original message for the "send new email" or "reply to email" functions
bzr revid: stephane@openerp.com-
20100409143544-smmsfmtfqvrha3cx
<field name="date"/>
<field name="duration"/>
</group>
- <separator colspan="4" string="Details"/>
+ <separator colspan="4" string="Notes"/>
<field name="description" nolabel="1" colspan="4"/>
<separator colspan="4"/>
<group col="8" colspan="4">
icon="gtk-go-forward" />
</group>
- <separator colspan="4" string="Details"/>
+ <separator colspan="4" string="Notes"/>
<field name="description" colspan="4"
nolabel="1" widget="text_tag" readonly="1" />
<separator colspan="4"/>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<button colspan="4"
- string="Reply to Email"
+ string="Reply to Last Email"
name="%(action_crm_send_mail)d"
- context="{'mail':'reply', 'model': 'crm.lead'}"
+ context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
"""
hist_obj = self.pool.get('crm.case.history')
res_ids = context and context.get('active_ids', []) or []
+
+ include_original = context and context.get('include_original', False) or False
res = {}
for hist in hist_obj.browse(cr, uid, res_ids):
model = hist.log_id.model_id.model
res.update({'email_from': (case.section_id and case.section_id.reply_to) or \
(case.user_id and case.user_id.address_id and \
case.user_id.address_id.email) or hist.email_to or tools.config.get('email_from',False)})
- if 'text' in fields:
+
+ if include_original == True and 'text' in fields:
header = '-------- Original Message --------'
sender = 'From: %s' %(hist.email_from or '')
to = 'To: %s' % (hist.email_to or '')