[IMP] emails :- change emails.message.send wizard name to email.compose.message wizard and related changes in some module.

bzr revid: ysa@tinyerp.com-20110221095401-pl0pyhzr7h8w7mjl
This commit is contained in:
Yogesh (OpenERP)
2011-02-21 15:24:01 +05:30
parent 013c86e610
commit 748860ca60
14 changed files with 41 additions and 81 deletions
-32
View File
@@ -288,38 +288,6 @@ class crm_lead(crm_case, osv.osv):
}
return value
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 write(self, cr, uid, ids, vals, context=None):
if not context:
context = {}
+3 -3
View File
@@ -170,7 +170,7 @@
<field name="history" invisible="1"/>
<button
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action" />
</tree>
@@ -188,7 +188,7 @@
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="description" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</group>
@@ -207,7 +207,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
<button string="Send New Email"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'crm.lead', 'record_id' : active_id}"
icon="terp-mail-message-new" type="action"/>
</page>
+2 -2
View File
@@ -155,7 +155,7 @@
<field name="display_text" string="History Information"/>
<field name="history" invisible="1"/>
<button string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</tree>
@@ -173,7 +173,7 @@
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="description" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</group>
+3 -3
View File
@@ -161,7 +161,7 @@
<field name="display_text" string="History Information"/>
<button
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.claim', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action" />
</tree>
@@ -179,7 +179,7 @@
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="description" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.claim', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</group>
@@ -198,7 +198,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
<button string="Send New Email"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'crm.claim', 'record_id' : active_id}"
icon="terp-mail-message-new" type="action"/>
</page>
@@ -150,7 +150,7 @@
<field name="history" invisible="1"/>
<button
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.fundraising', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action" />
</tree>
@@ -168,7 +168,7 @@
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="description" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.fundraising', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</group>
@@ -187,7 +187,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
<button string="Send New Email"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'crm.fundraising', 'record_id' : active_id}"
icon="terp-mail-message-new" type="action"/>
</page>
+3 -3
View File
@@ -102,7 +102,7 @@
<field name="history" invisible="1"/>
<button
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.helpdesk', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action" />
</tree>
@@ -120,7 +120,7 @@
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="description" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.helpdesk', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</group>
@@ -139,7 +139,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
<button string="Send New Email"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'crm.helpdesk', 'record_id' : active_id}"
icon="terp-mail-message-new" type="action"/>
</page>
+1 -1
View File
@@ -32,7 +32,7 @@
'depends': ['base', 'base_tools'],
'init_xml': [],
'update_xml': [
"wizard/email_message_wizard_send_view.xml",
"wizard/email_compose_message_view.xml",
"email_view.xml",
"res_partner_view.xml",
'security/ir.model.access.csv',
+1 -1
View File
@@ -34,7 +34,7 @@
<field name="res_id" readonly="1"/>
<button name="open_document" string="Open Document" type="object" icon="gtk-jump-to"/>
<field name="message_id"/>
<button name="%(action_email_message_wizard_send)d" string="Reply" type="action" icon="terp-mail-replied"
<button name="%(action_email_compose_message_wizard)d" string="Reply" type="action" icon="terp-mail-replied"
context="{'mail':'reply', 'message_id':active_id}"/>
</group>
</group>
+1 -1
View File
@@ -19,6 +19,6 @@
#
##############################################################################
import email_message_wizard_send
import email_compose_message
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -23,15 +23,15 @@ from osv import osv
from osv import fields
import tools
class email_message_wizard_send(osv.osv_memory):
_name = 'email.message.wizard_send'
_inherit = 'email.message'
_description = 'This is the wizard for send e-mail'
class email_compose_message(osv.osv_memory):
_name = 'email.compose.message'
_inherit = 'email.message.template'
_description = 'This is the wizard for Compose E-mail'
def default_get(self, cr, uid, fields, context=None):
if context is None:
context = {}
result = super(email_message_wizard_send, self).default_get(cr, uid, fields, context=context)
result = super(email_compose_message, self).default_get(cr, uid, fields, context=context)
message_pool = self.pool.get('email.message')
message_id = context.get('message_id', False)
message_data = False
@@ -50,13 +50,13 @@ class email_message_wizard_send(osv.osv_memory):
if 'description' in fields and hasattr(data, 'description'):
result['description'] = '\n' + (tools.ustr(data.user_id.signature or ''))
if 'model' in fields and hasattr(data, 'model'):
if 'model' in fields:
result['model'] = context.get('model','')
if 'email_cc' in fields and hasattr(data, 'email_cc'):
result['email_cc'] = tools.ustr(data.email_cc or '')
if 'res_id' in fields and hasattr(data, 'res_id'):
if 'res_id' in fields:
result['res_id'] = context.get('record_id',0)
if 'reply_to' in fields and hasattr(data, 'reply_to'):
@@ -64,12 +64,6 @@ class email_message_wizard_send(osv.osv_memory):
elif message_id:
message_data = message_pool.browse(cr, uid, int(message_id), context)
if 'template_id' in fields:
result['template_id'] = message_data and message_data.template_id and message_data.template_id.id or False
if 'smtp_server_id' in fields:
result['smtp_server_id'] = message_data and message_data.smtp_server_id and message_data.smtp_server_id.id or False
if 'message_id' in fields:
result['message_id'] = message_data and message_data.message_id
@@ -129,9 +123,6 @@ class email_message_wizard_send(osv.osv_memory):
if 'priority' in fields:
result['priority'] = message_data and message_data.priority
if 'partner_id' in fields:
result['partner_id'] = message_data and message_data.partner_id and message_data.partner_id.id or False
if 'debug' in fields:
result['debug'] = message_data and message_data.debug
@@ -139,6 +130,7 @@ class email_message_wizard_send(osv.osv_memory):
_columns = {
'attachment_ids': fields.many2many('ir.attachment','email_message_send_attachment_rel', 'wizard_id', 'attachment_id', 'Attachments'),
'debug':fields.boolean('Debug', readonly=True),
}
def save_to_drafts(self, cr, uid, ids, context=None):
@@ -168,6 +160,6 @@ class email_message_wizard_send(osv.osv_memory):
email_ids.append(email_id)
return email_ids
email_message_wizard_send()
email_compose_message()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -2,9 +2,9 @@
<openerp>
<data>
<record model="ir.ui.view" id="email_message_wizard_send_form">
<field name="name">email.message.wizard_send.form</field>
<field name="model">email.message.wizard_send</field>
<record model="ir.ui.view" id="email_compose_message_wizard_form">
<field name="name">email.compose.message.form</field>
<field name="model">email.compose.message</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Reply Email">
@@ -36,10 +36,10 @@
</field>
</record>
<record id="action_email_message_wizard_send" model="ir.actions.act_window">
<record id="action_email_compose_message_wizard" model="ir.actions.act_window">
<field name="name">Send E-mail</field>
<field name="res_model">email.message.wizard_send</field>
<field name="src_model">email.message.wizard_send</field>
<field name="res_model">email.compose.message</field>
<field name="src_model">email.compose.message</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
+3 -3
View File
@@ -393,7 +393,7 @@
<field name="history" invisible="1"/>
<button
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'event.registration', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action" />
</tree>
@@ -411,7 +411,7 @@
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="description" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'event.registration', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</group>
@@ -430,7 +430,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
<button string="Send New Email"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'event.registration', 'record_id' : active_id}"
icon="terp-mail-message-new" type="action"/>
</page>
@@ -147,7 +147,7 @@
<field name="history" invisible="1"/>
<button
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'hr.applicant', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action" />
</tree>
@@ -165,7 +165,7 @@
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="description" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'hr.applicant', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</group>
@@ -184,7 +184,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
<button string="Send New Email"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'hr.applicant', 'record_id' : active_id}"
icon="terp-mail-message-new" type="action"/>
</page>
+3 -3
View File
@@ -103,7 +103,7 @@
<field name="history" invisible="1"/>
<button
string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'crm.lead', 'project.issue' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action" />
</tree>
@@ -121,7 +121,7 @@
<group attrs="{'invisible': [('history', '!=', True)]}">
<field name="description" colspan="4" nolabel="1" height="250"/>
<button colspan="4" string="Reply"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'reply', 'model': 'project.issue', 'include_original' : True, 'message_id':active_id}"
icon="terp-mail-replied" type="action"/>
</group>
@@ -141,7 +141,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
<button string="Send New Email"
name="%(emails.action_email_message_wizard_send)d"
name="%(emails.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'project.issue', 'record_id' : active_id}"
icon="terp-mail-message-new" type="action"/>
</page>