[IMP] project_issue :- call email.message.send.wizard in oprtunity instead of crm.send.mail wizard.
bzr revid: ysa@tinyerp.com-20110218115656-off7dhkdo0n5sh71
This commit is contained in:
@@ -243,6 +243,38 @@ class project_issue(crm.crm_case, osv.osv):
|
||||
'project_id':_get_project,
|
||||
}
|
||||
|
||||
def action_send_email(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
Open Send email wizard.
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
for data in self.browse(cr, uid ,ids, context):
|
||||
context.update({
|
||||
'mail':'new',
|
||||
'default_name': data.name,
|
||||
'default_email_to': data.email_from,
|
||||
'default_email_from': data.user_id and data.user_id.address_id and data.user_id.address_id.email,
|
||||
'default_description': '\n' + (tools.ustr(data.user_id.signature or '')),
|
||||
'default_model': context.get('model',''),
|
||||
'default_email_cc': tools.ustr(data.email_cc or ''),
|
||||
'default_res_id': context.get('rec_id',0)
|
||||
})
|
||||
if hasattr(data, 'section_id'):
|
||||
context.update({'default_reply_to': data.section_id and data.section_id.reply_to or False})
|
||||
|
||||
result = {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'email.message.wizard_send',
|
||||
'view_id': False,
|
||||
'context': context,
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
'nodestroy': True
|
||||
}
|
||||
return result
|
||||
|
||||
def convert_issue_task(self, cr, uid, ids, context=None):
|
||||
case_obj = self.pool.get('project.issue')
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
||||
@@ -101,11 +101,11 @@
|
||||
<tree string="History">
|
||||
<field name="display_text" string="History Information"/>
|
||||
<field name="history" invisible="1"/>
|
||||
<button
|
||||
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'project.issue', 'include_original' : True}"
|
||||
icon="terp-mail-replied" type="action" />
|
||||
<button
|
||||
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
|
||||
name="%(emails.action_email_message_wizard_send)d"
|
||||
context="{'mail':'reply', 'model': 'crm.lead', 'project.issue' : True, 'message_id':active_id}"
|
||||
icon="terp-mail-replied" type="action" />
|
||||
</tree>
|
||||
<form string="History">
|
||||
<group col="4" colspan="4">
|
||||
@@ -120,11 +120,10 @@
|
||||
<page string="Details">
|
||||
<group attrs="{'invisible': [('history', '!=', True)]}">
|
||||
<field name="description" colspan="4" nolabel="1" height="250"/>
|
||||
<button colspan="4"
|
||||
string="Reply"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'reply', 'model': 'project.issue', 'include_original' : True}"
|
||||
icon="terp-mail-replied" type="action" />
|
||||
<button colspan="4" string="Reply"
|
||||
name="%(emails.action_email_message_wizard_send)d"
|
||||
context="{'mail':'reply', 'model': 'project.issue', 'include_original' : True, 'message_id':active_id}"
|
||||
icon="terp-mail-replied" type="action"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('history', '=', True)]}">
|
||||
<field name="display_text" colspan="4" nolabel="1" height="250"/>
|
||||
@@ -141,10 +140,10 @@
|
||||
name="%(crm.action_crm_add_note)d"
|
||||
context="{'model': 'crm.lead' }"
|
||||
icon="terp-document-new" type="action" />
|
||||
<button string="Send New Email"
|
||||
name="%(crm.action_crm_send_mail)d"
|
||||
context="{'mail':'new', 'model': 'project.issue'}"
|
||||
icon="terp-mail-message-new" type="action" />
|
||||
<button string="Send New Email"
|
||||
name="action_send_email"
|
||||
context="{'mail':'new', 'model': 'project.issue', 'rec_id' : active_id}"
|
||||
icon="terp-mail-message-new" type="object"/>
|
||||
</page>
|
||||
<page string="Extra Info" groups="base.group_extended">
|
||||
<group col="2" colspan="2">
|
||||
|
||||
Reference in New Issue
Block a user