diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index c45a18b7ddc..60e2f447c0d 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -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 = {}
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index a7479b8cdef..019e74f19d1 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -170,7 +170,7 @@
@@ -188,7 +188,7 @@
@@ -207,7 +207,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 993070d31c4..84d577a173f 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -155,7 +155,7 @@
@@ -173,7 +173,7 @@
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index 950dcf7bd26..84bd7ef0aaa 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -161,7 +161,7 @@
@@ -179,7 +179,7 @@
@@ -198,7 +198,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
diff --git a/addons/crm_fundraising/crm_fundraising_view.xml b/addons/crm_fundraising/crm_fundraising_view.xml
index bd454a266a1..82d55f462f3 100644
--- a/addons/crm_fundraising/crm_fundraising_view.xml
+++ b/addons/crm_fundraising/crm_fundraising_view.xml
@@ -150,7 +150,7 @@
@@ -168,7 +168,7 @@
@@ -187,7 +187,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
diff --git a/addons/crm_helpdesk/crm_helpdesk_view.xml b/addons/crm_helpdesk/crm_helpdesk_view.xml
index 266e72e261c..e297328865f 100644
--- a/addons/crm_helpdesk/crm_helpdesk_view.xml
+++ b/addons/crm_helpdesk/crm_helpdesk_view.xml
@@ -102,7 +102,7 @@
@@ -120,7 +120,7 @@
@@ -139,7 +139,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
diff --git a/addons/emails/__openerp__.py b/addons/emails/__openerp__.py
index a3b6456921f..a6c24087055 100644
--- a/addons/emails/__openerp__.py
+++ b/addons/emails/__openerp__.py
@@ -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',
diff --git a/addons/emails/email_view.xml b/addons/emails/email_view.xml
index 585118f149d..4680ece3ee3 100644
--- a/addons/emails/email_view.xml
+++ b/addons/emails/email_view.xml
@@ -34,7 +34,7 @@
-
diff --git a/addons/emails/wizard/__init__.py b/addons/emails/wizard/__init__.py
index e8dc20ee171..16ba392b2d7 100644
--- a/addons/emails/wizard/__init__.py
+++ b/addons/emails/wizard/__init__.py
@@ -19,6 +19,6 @@
#
##############################################################################
-import email_message_wizard_send
+import email_compose_message
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/emails/wizard/email_message_wizard_send.py b/addons/emails/wizard/email_compose_message.py
similarity index 88%
rename from addons/emails/wizard/email_message_wizard_send.py
rename to addons/emails/wizard/email_compose_message.py
index 63e06319719..fce2a1fd316 100644
--- a/addons/emails/wizard/email_message_wizard_send.py
+++ b/addons/emails/wizard/email_compose_message.py
@@ -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:
diff --git a/addons/emails/wizard/email_message_wizard_send_view.xml b/addons/emails/wizard/email_compose_message_view.xml
similarity index 83%
rename from addons/emails/wizard/email_message_wizard_send_view.xml
rename to addons/emails/wizard/email_compose_message_view.xml
index f599939fd9d..c34b194bf87 100644
--- a/addons/emails/wizard/email_message_wizard_send_view.xml
+++ b/addons/emails/wizard/email_compose_message_view.xml
@@ -2,9 +2,9 @@
-
- email.message.wizard_send.form
- email.message.wizard_send
+
+ email.compose.message.form
+ email.compose.message
form
-
+
Send E-mail
- email.message.wizard_send
- email.message.wizard_send
+ email.compose.message
+ email.compose.message
ir.actions.act_window
form
form
diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml
index 1954c8e7294..d13c2826d23 100644
--- a/addons/event/event_view.xml
+++ b/addons/event/event_view.xml
@@ -393,7 +393,7 @@
@@ -411,7 +411,7 @@
@@ -430,7 +430,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index bdba2fd2fed..c71e434dc5e 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -147,7 +147,7 @@
@@ -165,7 +165,7 @@
@@ -184,7 +184,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index a0bb2a82898..4aed9f00d0e 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -103,7 +103,7 @@
@@ -121,7 +121,7 @@
@@ -141,7 +141,7 @@
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />