[FIX] body_text --> body, not ure it's good enough

bzr revid: fp@tinyerp.com-20120817120606-t97l9x2dguuv7kmp
This commit is contained in:
Fabien Pinckaers 2012-08-17 14:06:06 +02:00
parent a71b01ab24
commit 06f60b3517
41 changed files with 105 additions and 105 deletions

View File

@ -123,7 +123,7 @@
</div>
</div>
]]></field>
<field name="body_text"><![CDATA[
<field name="body"><![CDATA[
Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},
A new invoice is available for ${object.partner_id.name}:

View File

@ -9538,7 +9538,7 @@ msgid "Refund"
msgstr ""
#. module: account
#: model:email.template,body_text:account.email_template_edi_invoice
#: model:email.template,body:account.email_template_edi_invoice
msgid "\n"
"Hello${object.address_invoice_id.name and ' ' or ''}${object.address_invoice_id.name or ''},\n"
"\n"

View File

@ -9,7 +9,7 @@
<field name="email_from"><![CDATA[${object.company_id.name} <${object.company_id.email}>]]></field>
<field name="email_to" eval="False"><!--(set by reset_password module)--></field>
<field name="subject">Password reset</field>
<field name="body_text"><![CDATA[
<field name="body"><![CDATA[
A password reset was requested the OpenERP account linked to this email on ${object._auth_reset_password_host()}
You may change your password following this link:

View File

@ -312,8 +312,8 @@ class base_stage(object):
dest = case.user_id.email or ""
body = case.description or ""
for message in case.message_ids:
if message.email_from and message.body_text:
body = message.body_text
if message.email_from and message.body:
body = message.body
break
if not destination:

View File

@ -447,7 +447,7 @@ class crm_lead(base_stage, osv.osv):
oldest_id = opportunity_ids[0]
return self.browse(cr, uid, oldest_id, context=context)
def _mail_body_text(self, cr, uid, lead, fields, title=False, context=None):
def _mail_body(self, cr, uid, lead, fields, title=False, context=None):
body = []
if title:
body.append("%s\n" % (title))
@ -484,7 +484,7 @@ class crm_lead(base_stage, osv.osv):
for opportunity in opportunities:
subject.append(opportunity.name)
title = "%s : %s" % (merge_message, opportunity.name)
details.append(self._mail_body_text(cr, uid, opportunity, fields, title=title, context=context))
details.append(self._mail_body(cr, uid, opportunity, fields, title=title, context=context))
subject = subject[0] + ", ".join(subject[1:])
details = "\n\n".join(details)
@ -819,7 +819,7 @@ class crm_lead(base_stage, osv.osv):
if custom_values is None: custom_values = {}
custom_values.update({
'name': msg.get('subject') or _("No Subject"),
'description': msg.get('body_text'),
'description': msg.get('body'),
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),
'user_id': False,
@ -844,7 +844,7 @@ class crm_lead(base_stage, osv.osv):
'revenue': 'planned_revenue',
'probability':'probability',
}
for line in msg.get('body_text', '').split('\n'):
for line in msg.get('body', '').split('\n'):
line = line.strip()
res = tools.misc.command_re.match(line)
if res and maps.get(res.group(1).lower()):

View File

@ -23,7 +23,7 @@
!python {model: mail.compose.message}: |
lead_ids = self.pool.get('crm.lead').search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
context.update({'active_model': 'crm.lead','active_id': lead_ids[0]})
id = self.create(cr, uid, {'body_text': "Merci à l'intérêt pour notre produit.nous vous contacterons bientôt. Merci", 'email_from': 'sales@mycompany.com'}, context=context)
id = self.create(cr, uid, {'body': "Merci à l'intérêt pour notre produit.nous vous contacterons bientôt. Merci", 'email_from': 'sales@mycompany.com'}, context=context)
try:
self.send_mail(cr, uid, [id], context=context)
except:

View File

@ -194,7 +194,7 @@ class crm_claim(base_stage, osv.osv):
if custom_values is None: custom_values = {}
custom_values.update({
'name': msg.get('subject') or _("No Subject"),
'description': msg.get('body_text'),
'description': msg.get('body'),
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),
})
@ -219,7 +219,7 @@ class crm_claim(base_stage, osv.osv):
'revenue': 'planned_revenue',
'probability':'probability'
}
for line in msg['body_text'].split('\n'):
for line in msg['body'].split('\n'):
line = line.strip()
res = tools.misc.command_re.match(line)
if res and maps.get(res.group(1).lower()):

View File

@ -9,7 +9,7 @@
-
!python {model: crm.claim}: |
try:
self.message_update(cr, uid,[ref('crm_claim_4')], {'subject': 'Claim Update record','body_text': 'first training session completed',})
self.message_update(cr, uid,[ref('crm_claim_4')], {'subject': 'Claim Update record','body': 'first training session completed',})
except:
pass

View File

@ -105,7 +105,7 @@ class crm_helpdesk(base_state, osv.osv):
if custom_values is None: custom_values = {}
custom_values.update({
'name': msg.get('subject') or _("No Subject"),
'description': msg.get('body_text'),
'description': msg.get('body'),
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),
'user_id': False,
@ -129,7 +129,7 @@ class crm_helpdesk(base_state, osv.osv):
'revenue': 'planned_revenue',
'probability':'probability'
}
for line in msg['body_text'].split('\n'):
for line in msg['body'].split('\n'):
line = line.strip()
res = tools.misc.command_re.match(line)
if res and maps.get(res.group(1).lower()):

View File

@ -23,7 +23,7 @@
!python {model: crm.helpdesk}: |
question_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
try:
self.message_update(cr, uid, question_ids, {'subject': 'Link of product', 'body_text': 'www.openerp.com'})
self.message_update(cr, uid, question_ids, {'subject': 'Link of product', 'body': 'www.openerp.com'})
except:
pass

View File

@ -72,7 +72,7 @@ msgid "Geo Localize"
msgstr ""
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,body_text:0
#: help:crm.lead.forward.to.partner,body:0
msgid "Plain-text version of the message"
msgstr ""
@ -129,7 +129,7 @@ msgid "Highest"
msgstr ""
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,body_text:0
#: field:crm.lead.forward.to.partner,body:0
msgid "Text contents"
msgstr ""

View File

@ -62,9 +62,9 @@ class crm_lead_forward_to_partner(osv.osv_memory):
res_id = context.get('active_id')
model = context.get('active_model')
lead = self.pool.get(model).browse(cr, uid, res_id, context)
body_text = self._get_message_body_text(cr, uid, lead, history_type, context=context)
if body_text:
res = {'value': {'body_text' : body_text}}
body = self._get_message_body(cr, uid, lead, history_type, context=context)
if body:
res = {'value': {'body' : body}}
return res
def on_change_partner(self, cr, uid, ids, partner_id):
@ -99,7 +99,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
mode = context.get('mail.compose.message.mode')
if mode == 'mass_mail':
lead_ids = context and context.get('active_ids', []) or []
value = self.default_get(cr, uid, ['body_text', 'email_to', 'email_cc', 'subject', 'history'], context=context)
value = self.default_get(cr, uid, ['body', 'email_to', 'email_cc', 'subject', 'history'], context=context)
self.write(cr, uid, ids, value, context=context)
context['mail.compose.message.mode'] = mode
@ -125,7 +125,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
lead.write(cr, uid, [case.id], update_vals, context=context)
return res
def _get_info_body_text(self, cr, uid, lead, context=None):
def _get_info_body(self, cr, uid, lead, context=None):
field_names = []
proxy = self.pool.get(lead._name)
if lead.type == 'opportunity':
@ -135,14 +135,14 @@ class crm_lead_forward_to_partner(osv.osv_memory):
'zip', 'city', 'country_id', 'state_id', 'email_from',
'phone', 'fax', 'mobile', 'categ_id', 'description',
]
return proxy._mail_body_text(cr, uid, lead, field_names, context=context)
return proxy._mail_body(cr, uid, lead, field_names, context=context)
def _get_message_body_text(self, cr, uid, lead, mode='whole', context=None):
def _get_message_body(self, cr, uid, lead, mode='whole', context=None):
"""This function gets whole communication history and returns as top posting style
"""
mail_message = self.pool.get('mail.message')
message_ids = []
body = self._get_info_body_text(cr, uid, lead, context=context)
body = self._get_info_body(cr, uid, lead, context=context)
if mode in ('whole', 'latest'):
message_ids = lead.message_ids
message_ids = map(lambda x: x.id, filter(lambda x: x.email_from, message_ids))
@ -153,7 +153,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
sender = 'From: %s' %(message.email_from or '')
to = 'To: %s' % (message.email_to or '')
sentdate = 'Date: %s' % (message.date or '')
desc = '\n%s'%(message.body_text)
desc = '\n%s'%(message.body)
original = [header, sender, to, sentdate, desc, '\n']
original = '\n'.join(original)
body += original
@ -174,7 +174,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
email_cc = res.get('email_cc', "")
email = res.get('email_to', "")
subject = '%s: %s - %s' % (_('Fwd'), 'Lead forward', lead.name)
body = self._get_message_body_text(cr, uid, lead, body_type, context=context)
body = self._get_message_body(cr, uid, lead, body_type, context=context)
partner_assigned_id = lead.partner_assigned_id and lead.partner_assigned_id.id or False
user_id = False
if not partner_assigned_id:
@ -187,7 +187,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
res.update({
'subject' : subject,
'body_text' : body,
'body' : body,
'email_cc' : email_cc,
'email_to' : email,
'partner_assigned_id': partner_assigned_id,

View File

@ -32,7 +32,7 @@
<separator string="" colspan="4"/>
<notebook colspan="4">
<page string="Body">
<field name="body_text" colspan="4" nolabel="1"/>
<field name="body" colspan="4" nolabel="1"/>
</page>
<page string="Attachments">
<label string="Add here all attachments of the current document you want to include in the Email." colspan="4"/>

View File

@ -151,7 +151,7 @@ class email_template(osv.osv):
'mail_server_id': fields.many2one('ir.mail_server', 'Outgoing Mail Server', readonly=False,
help="Optional preferred server for outgoing mails. If not set, the highest "
"priority one will be used."),
'body_text': fields.text('Text Contents', translate=True, help="Plaintext version of the message (placeholders may be used here)"),
'body': fields.text('Text Contents', translate=True, help="Plaintext version of the message (placeholders may be used here)"),
'body_html': fields.text('Rich-text Contents', translate=True, help="Rich-text/HTML version of the message (placeholders may be used here)"),
'message_id': fields.char('Message-Id', size=256, help="Message-ID SMTP header to use in outgoing messages based on this template. "
"Please note that this overrides the 'Resource Tracking' option, "
@ -300,7 +300,7 @@ class email_template(osv.osv):
context = {}
values = {
'subject': False,
'body_text': False,
'body': False,
'body_html': False,
'email_from': False,
'email_to': False,
@ -323,7 +323,7 @@ class email_template(osv.osv):
report_xml_pool = self.pool.get('ir.actions.report.xml')
template = self.get_email_template(cr, uid, template_id, res_id, context)
for field in ['subject', 'body_text', 'body_html', 'email_from',
for field in ['subject', 'body', 'body_html', 'email_from',
'email_to', 'email_cc', 'reply_to',
'message_id']:
values[field] = self.render_template(cr, uid, getattr(template, field),
@ -342,7 +342,7 @@ class email_template(osv.osv):
if template.user_signature:
signature = self.pool.get('res.users').browse(cr, uid, uid, context).signature
values['body_text'] += '\n\n' + signature
values['body'] += '\n\n' + signature
values.update(mail_server_id = template.mail_server_id.id or False,
auto_delete = template.auto_delete,

View File

@ -23,7 +23,7 @@
<field name="subject" required="1"/>
<notebook colspan="4">
<page string="Body (Text)">
<field name="body_text" colspan="4" width="250" height="250" nolabel="1"/>
<field name="body" colspan="4" width="250" height="250" nolabel="1"/>
</page>
<page string="Body (Rich/HTML)">
<field name="body_html" colspan="4" width="250" height="250" nolabel="1"/>

View File

@ -289,8 +289,8 @@ msgid "Add Signature"
msgstr ""
#. module: email_template
#: help:email.template,body_text:0
#: help:email_template.preview,body_text:0
#: help:email.template,body:0
#: help:email_template.preview,body:0
msgid "Plaintext version of the message (placeholders may be used here)"
msgstr ""
@ -425,8 +425,8 @@ msgid "Cc"
msgstr ""
#. module: email_template
#: field:email.template,body_text:0
#: field:email_template.preview,body_text:0
#: field:email.template,body:0
#: field:email_template.preview,body:0
msgid "Text Contents"
msgstr ""

View File

@ -81,11 +81,11 @@ class email_template_preview(osv.osv_memory):
vals['email_cc'] = self.render_template(cr, uid, template.email_cc, model, res_id, context)
vals['reply_to'] = self.render_template(cr, uid, template.reply_to, model, res_id, context)
vals['subject'] = self.render_template(cr, uid, template.subject, model, res_id, context)
description = self.render_template(cr, uid, template.body_text, model, res_id, context) or ''
description = self.render_template(cr, uid, template.body, model, res_id, context) or ''
if template.user_signature:
signature = self.pool.get('res.users').browse(cr, uid, uid, context).signature
description += '\n' + signature
vals['body_text'] = description
vals['body'] = description
if template.body_html:
vals['body_html'] = self.render_template(cr, uid, template.body_html, model, res_id, context) or ''
vals['report_name'] = self.render_template(cr, uid, template.report_name, model, res_id, context)

View File

@ -18,7 +18,7 @@
<group col="4" colspan="4">
<notebook>
<page string="Body (Text)">
<field name="body_text" nolabel="1" colspan="4" height="350" width="350" readonly="1"/>
<field name="body" nolabel="1" colspan="4" height="350" width="350" readonly="1"/>
</page>
<page string="Body (Rich/HTML)" attrs="{'invisible': [('body_html','=', False)]}">
<field name="body_html" nolabel="1" colspan="4" height="350" width="350" readonly="1"/>

View File

@ -135,7 +135,7 @@ class mail_compose_message(osv.osv_memory):
'name': template_name,
'email_from': record.email_from or False,
'subject': record.subject or False,
'body_text': record.body_text or False,
'body': record.body or False,
'email_to': record.email_to or False,
'email_cc': record.email_cc or False,
'reply_to': record.reply_to or False,

View File

@ -7,7 +7,7 @@
<field name="email_from" >${object.user_id.email or object.company_id.email or 'noreply@' + object.company_id.name + '.com'}</field>
<field name="email_to" >${object.email}</field>
<field name="subject">Your registration at ${object.event_id.name}</field>
<field name="body_text">
<field name="body">
hello ${object.name},
The event ${object.event_id.name} that you registered for is confirmed and will be held from ${object.event_id.date_begin} to ${object.event_id.date_end}. For any further information please contact our event department.
@ -27,7 +27,7 @@
<field name="email_from" >${object.user_id.email or object.company_id.email or 'noreply@' + object.company_id.name + '.com'}</field>
<field name="email_to" >${object.email}</field>
<field name="subject">Your registration at ${object.event_id.name}</field>
<field name="body_text">
<field name="body">
hello ${object.name},
We confirm you that your registration to the event ${object.event_id.name} has been recorded. You will automatically receive an email providing you more practical information (such as the schedule, the plan...) as soon as the event will be confirmed to be held.

View File

@ -46,7 +46,7 @@ class mail_compose_message(osv.osv_memory):
result.update({
'email_to': record_data.user_to_review_id.work_email or False,
'subject': _("Reminder to fill up Survey"),
'body_text': msg,
'body': msg,
})
return result

View File

@ -332,7 +332,7 @@ class hr_applicant(base_stage, osv.Model):
if custom_values is None: custom_values = {}
custom_values.update({
'name': msg.get('subject') or _("No Subject"),
'description': msg.get('body_text'),
'description': msg.get('body'),
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),
'user_id': False,
@ -363,7 +363,7 @@ class hr_applicant(base_stage, osv.Model):
'revenue': 'planned_revenue',
'probability': 'probability',
}
for line in msg.get('body_text', '').split('\n'):
for line in msg.get('body', '').split('\n'):
line = line.strip()
res = tools.misc.command_re.match(line)
if res and maps.get(res.group(1).lower(), False):

View File

@ -425,7 +425,7 @@ class import_framework(Thread):
email_id = email_obj.create(self.cr, self.uid, {
'email_from' : 'import@module.openerp',
'email_to' : self.email,
'body_text' : self.get_email_body(result, error),
'body' : self.get_email_body(result, error),
'subject' : self.get_email_subject(result, error),
'auto_delete' : True})
email_obj.send(self.cr, self.uid, [email_id])

View File

@ -226,7 +226,7 @@ class sugar_import(import_framework):
'model': 'model',
'partner_id/.id': 'partner_id/.id',
'user_id/id': ref(self.TABLE_USER, 'assigned_user_id'),
'body_text': 'description',
'body': 'description',
'body_html' : 'description_html',
}

View File

@ -147,7 +147,7 @@ The best way to direct the messages that will be displayed in the OpenChatter wi
# add: search in the current task project messages
'&', '&', ('res_id', '=', my_task.project_id.id), ('model', '=', 'project.project'),
# ... containing the task name
'|', ('body_text', 'like', '%s' % (my_task.name)), ('body_html', 'like', '%s' % (my_task.name))
'|', ('body', 'like', '%s' % (my_task.name)), ('body_html', 'like', '%s' % (my_task.name))
] + domain, limit=limit, offset=offset, context=context)
# if asked: add ancestor ids to have complete threads
if (ascent): msg_ids = self._message_add_ancestor_ids(cr, uid, ids, msg_ids, root_ids, context=context)

View File

@ -108,7 +108,7 @@ class mail_mail(osv.Model):
'model': model,
'res_id': res_id,
'type': type,
'body_text': body if content_subtype != 'html' else False,
'body': body if content_subtype != 'html' else False,
'body_html': body if content_subtype == 'html' else False,
'email_from': email_from,
'email_to': email_to and ','.join(email_to) or '',
@ -214,13 +214,13 @@ class mail_mail(osv.Model):
for attach in message.attachment_ids:
attachments.append((attach.datas_fname, base64.b64decode(attach.datas)))
body = message.body_html if message.content_subtype == 'html' else message.body_text
body = message.body_html if message.content_subtype == 'html' else message.body
body_alternative = None
content_subtype_alternative = None
if message.content_subtype == 'html' and message.body_text:
if message.content_subtype == 'html' and message.body:
# we have a plain text alternative prepared, pass it to
# build_message instead of letting it build one
body_alternative = message.body_text
body_alternative = message.body
content_subtype_alternative = 'plain'
# handle destination_partners

View File

@ -72,8 +72,8 @@ class mail_message(osv.Model):
name = ''
if message.subject:
name = '%s: ' % (message.subject)
if message.body_text:
name = name + message.body_text[0:20]
if message.body:
name = name + message.body[0:20]
res.append((message.id, name))
return res

View File

@ -622,7 +622,7 @@ class mail_thread(osv.Model):
#.. all X- headers...
},
'content_subtype': msg_mime_subtype, --> to remove
'body_text': plaintext_body --> keep body
'body': plaintext_body --> keep body
'body_html': html_body, --> to remove
'attachments': [('file1', 'bytes'),
('file2', 'bytes') }

View File

@ -36,7 +36,7 @@
}
.openerp div.oe_mail_wall_action textarea.oe_mail_compose_textarea,
.openerp div.oe_mail_wall_action div.oe_mail_compose_message_body_text textarea {
.openerp div.oe_mail_wall_action div.oe_mail_compose_message_body textarea {
width: 474px;
height: 60px;
padding: 4px;
@ -165,9 +165,9 @@
clear: both;
}
/* default textarea (oe_mail_compose_textarea), and body_text textarea for compose form view */
/* default textarea (oe_mail_compose_textarea), and body textarea for compose form view */
.openerp .oe_mail_msg_content textarea.oe_mail_compose_textarea,
.openerp .oe_mail_msg_content div.oe_mail_compose_message_body_text textarea {
.openerp .oe_mail_msg_content div.oe_mail_compose_message_body textarea {
width: 474px;
height: 60px;
padding: 4px;
@ -175,9 +175,9 @@
border: 1px solid #cccccc;
}
/* default textarea (oe_mail_compose_textarea), and body_text textarea for compose form view */
/* default textarea (oe_mail_compose_textarea), and body textarea for compose form view */
.openerp .oe_mail_msg_content textarea.oe_mail_compose_textarea:focus,
.openerp .oe_mail_msg_content div.oe_mail_compose_message_body_text textarea:focus {
.openerp .oe_mail_msg_content div.oe_mail_compose_message_body textarea:focus {
outline: 0;
border-color: rgba(82, 168, 236, 0.8);
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);

View File

@ -321,7 +321,7 @@ openerp.mail = function(session) {
reinit: function() {
var self = this;
if (! this.form_view) return;
var call_defer = this.ds_compose.call('default_get', [['subject', 'body_text', 'body_html', 'dest_partner_ids'], this.ds_compose.get_context()]).then(
var call_defer = this.ds_compose.call('default_get', [['subject', 'body', 'body_html', 'dest_partner_ids'], this.ds_compose.get_context()]).then(
function (result) {
self.form_view.on_processed_onchange({'value': result}, []);
});
@ -441,7 +441,7 @@ openerp.mail = function(session) {
this.ds_compose.context.formatting = this.formatting;
// toggle display
this.$element.find('span.oe_mail_compose_message_subject').toggleClass('oe_mail_compose_message_invisible');
this.$element.find('div.oe_mail_compose_message_body_text').toggleClass('oe_mail_compose_message_invisible');
this.$element.find('div.oe_mail_compose_message_body').toggleClass('oe_mail_compose_message_invisible');
this.$element.find('div.oe_mail_compose_message_body_html').toggleClass('oe_mail_compose_message_invisible');
},
@ -472,9 +472,9 @@ openerp.mail = function(session) {
/**
* Update the values of the composition form; with possible different
* values for body_text and body_html. */
set_body_value: function(body_text, body_html) {
this.form_view.fields.body_text.set_value(body_text);
* values for body and body_html. */
set_body_value: function(body, body_html) {
this.form_view.fields.body.set_value(body);
this.form_view.fields.body_html.set_value(body_html);
},
}),
@ -776,9 +776,9 @@ openerp.mail = function(session) {
do_comment: function () {
var comment_node = this.$element.find('textarea');
var body_text = comment_node.val();
var body = comment_node.val();
comment_node.val('');
return this.ds.call('message_post', [[this.params.res_id], body_text], {parent_id: this.params.parent_id, mtype: 'comment'}).then(
return this.ds.call('message_post', [[this.params.res_id], body], {parent_id: this.params.parent_id, mtype: 'comment'}).then(
this.proxy('init_comments'));
},

View File

@ -140,7 +140,7 @@ class mail_compose_message(osv.TransientModel):
'res_id': res_id,
'email_from': user.email or tools.config.get('email_from', False),
'body_html': False,
'body_text': False,
'body': False,
'subject': False,
'dest_partner_ids': [],
})
@ -204,11 +204,11 @@ class mail_compose_message(osv.TransientModel):
# version. TODO: make it possible to switch to HTML on the fly
sent_date = _('On %(date)s, ') % {'date': message_data.date} if message_data.date else ''
sender = _('%(sender_name)s wrote:') % {'sender_name': tools.ustr(message_data.email_from or _('You'))}
body_text = message_data.body_text or ''
body = message_data.body or ''
body_html = message_data.body_html or ''
quoted_body_text = '> %s' % tools.ustr(body_text.replace('\n', "\n> ") or '')
quoted_body = '> %s' % tools.ustr(body.replace('\n', "\n> ") or '')
quoted_body_html = '<blockquote>%s</blockquote>' % (tools.ustr(body_html)),
reply_body_text = '\n%s%s\n%s\n%s' % (sent_date, sender, quoted_body_text, current_user.signature)
reply_body = '\n%s%s\n%s\n%s' % (sent_date, sender, quoted_body, current_user.signature)
reply_body_html = '<br /><br />%s%s<br />%s<br />%s' % (sent_date, sender, quoted_body_html, current_user.signature)
# form dest_partner_ids
dest_partner_ids = [partner.id for partner in message_data.partner_ids]
@ -221,7 +221,7 @@ class mail_compose_message(osv.TransientModel):
reply_headers['In-Reply-To'] = message_data.message_id
# update the result
result.update({
'body_text': reply_body_text,
'body': reply_body,
'body_html': reply_body_html,
'subject': reply_subject,
'attachment_ids': [],
@ -274,7 +274,7 @@ class mail_compose_message(osv.TransientModel):
partner_ids = [partner.id for partner in mail_wiz.dest_partner_ids]
references = None
headers = {}
body = mail_wiz.body_html if content_subtype == 'html' else mail_wiz.body_text
body = mail_wiz.body_html if content_subtype == 'html' else mail_wiz.body
# get model, active_ids, and check if model is openchatter-enabled
if mass_mail_mode and context.get('active_ids') and context.get('active_model'):
@ -295,7 +295,7 @@ class mail_compose_message(osv.TransientModel):
for active_id in active_ids:
rendered_subject = self.render_template(cr, uid, subject, active_model, active_id)
rendered_body_html = self.render_template(cr, uid, mail_wiz.body_html, active_model, active_id)
rendered_body_text = self.render_template(cr, uid, mail_wiz.body_text, active_model, active_id)
rendered_body = self.render_template(cr, uid, mail_wiz.body, active_model, active_id)
email_from = self.render_template(cr, uid, mail_wiz.email_from, active_model, active_id)
email_to = self.render_template(cr, uid, mail_wiz.email_to, active_model, active_id)
email_cc = self.render_template(cr, uid, mail_wiz.email_cc, active_model, active_id)
@ -304,24 +304,24 @@ class mail_compose_message(osv.TransientModel):
# in mass-mailing mode we only schedule the mail for sending, it will be
# processed as soon as the mail scheduler runs.
if mail_thread_enabled:
active_model_pool.message_append(cr, uid, [active_id], rendered_subject, rendered_body_text, rendered_body_html,
active_model_pool.message_append(cr, uid, [active_id], rendered_subject, rendered_body, rendered_body_html,
type=type, content_subtype=content_subtype, state=state, partner_ids=partner_ids,
email_from=email_from, email_to=email_to, email_cc=email_cc,
reply_to=reply_to, references=references, attachments=attachment, headers=headers, context=context)
else:
mail_message_obj.schedule_with_attach(cr, uid, email_from, mail_tools_to_email(email_to), subject, rendered_body_text,
mail_message_obj.schedule_with_attach(cr, uid, email_from, mail_tools_to_email(email_to), subject, rendered_body,
model=mail_wiz.model, email_cc=mail_tools_to_email(email_cc), reply_to=reply_to,
attachments=attachment, references=references, res_id=active_id, partner_ids=partner_ids,
content_subtype=mail_wiz.content_subtype, headers=headers, context=context)
else:
# normal mode - no mass-mailing
if mail_thread_enabled:
msg_ids = active_model_pool.message_append(cr, uid, active_ids, subject, mail_wiz.body_text, mail_wiz.body_html,
msg_ids = active_model_pool.message_append(cr, uid, active_ids, subject, mail_wiz.body, mail_wiz.body_html,
type=type, content_subtype=content_subtype, state=state, partner_ids=partner_ids,
email_from=mail_wiz.email_from, email_to=mail_wiz.email_to, email_cc=mail_wiz.email_cc,
reply_to=mail_wiz.reply_to, references=references, attachments=attachment, headers=headers, context=context)
else:
msg_ids = [mail_message_obj.schedule_with_attach(cr, uid, mail_wiz.email_from, mail_tools_to_email(mail_wiz.email_to), subject, mail_wiz.body_text,
msg_ids = [mail_message_obj.schedule_with_attach(cr, uid, mail_wiz.email_from, mail_tools_to_email(mail_wiz.email_to), subject, mail_wiz.body,
type=type, model=mail_wiz.model, email_cc=mail_tools_to_email(mail_wiz.email_cc), reply_to=mail_wiz.reply_to,
attachments=attachment, references=references, res_id=int(mail_wiz.res_id), partner_ids=partner_ids,
content_subtype=mail_wiz.content_subtype, headers=headers, context=context)]

View File

@ -41,7 +41,7 @@
<field name="subject" colspan="2" nolabel="1" placeholder="Subject..."
class="oe_mail_compose_message_subject oe_mail_compose_message_invisible"/>
<field name="body" colspan="2" nolabel="1" placeholder="What are you working on ?"
class="oe_mail_compose_message_body_text"/>
class="oe_mail_compose_message_body"/>
<field name="body_html" colspan="2" nolabel="1" placeholder="What are you working on HTML ?"
class="oe_mail_compose_message_body_html oe_mail_compose_message_invisible"/>
<field name="dest_partner_ids" colspan="2" nolabel="1" widget="many2many_tags"

View File

@ -8,7 +8,7 @@
<field name="subject">Welcome in OpenERP Partner Channel!</field>
<field name="email_to">${object.email or ''}</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="body_text">Hello, We are very happy to send Welcome message.</field>
<field name="body">Hello, We are very happy to send Welcome message.</field>
</record>
<record id="email_template_2" model="email.template">
<field name="name">Template for Silver Partner</field>
@ -16,7 +16,7 @@
<field name="subject">Congratulation! You become now our Silver Partner.</field>
<field name="email_to">${object.email or ''}</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="body_text">Hello, We are happy to announce that you now become our Silver Partner.</field>
<field name="body">Hello, We are happy to announce that you now become our Silver Partner.</field>
</record>
<record id="email_template_3" model="email.template">
@ -25,7 +25,7 @@
<field name="subject">Congratulation! You become our Gold Partner.</field>
<field name="email_to">${object.email or ''}</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="body_text">Hello, We are happy to announce that you become our Gold Partner.</field>
<field name="body">Hello, We are happy to announce that you become our Gold Partner.</field>
</record>

View File

@ -40,7 +40,7 @@
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="model_id" ref="crm.model_crm_lead"/>
<field eval="0" name="user_signature"/>
<field name="body_text">Hello,Thanks for generous interest you have shown in the openERP.Regards,OpenERP Team,</field>
<field name="body">Hello,Thanks for generous interest you have shown in the openERP.Regards,OpenERP Team,</field>
<field name="name">For OpenERP OnDemand Free Trial 2010</field>
</record>
<record id="email_template_2" model="email.template">
@ -50,7 +50,7 @@
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="model_id" ref="crm.model_crm_lead"/>
<field eval="0" name="user_signature"/>
<field name="body_text">Hello,We have very good offer that might suit you.
<field name="body">Hello,We have very good offer that might suit you.
We propose you to subscribe to the OpenERP Discovery Day on May 2010.
If any further information required kindly revert back.
We really appreciate your co-operation on this.
@ -65,7 +65,7 @@
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="model_id" ref="crm.model_crm_lead"/>
<field eval="0" name="user_signature"/>
<field name="body_text">Hello,Thanks for showing intrest and for subscribing to the OpenERP Discovery Day.
<field name="body">Hello,Thanks for showing intrest and for subscribing to the OpenERP Discovery Day.
If any further information required kindly revert back.
I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
@ -79,7 +79,7 @@
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="model_id" ref="crm.model_crm_lead"/>
<field eval="0" name="user_signature"/>
<field name="body_text">Hello,Thanks for showing intrest and buying the OpenERP book.
<field name="body">Hello,Thanks for showing intrest and buying the OpenERP book.
If any further information required kindly revert back.
I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
@ -92,7 +92,7 @@
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field eval="0" name="user_signature"/>
<field name="body_text">Hello, We have very good offer that might suit you.
<field name="body">Hello, We have very good offer that might suit you.
For our gold partners,We are arranging free technical training on june,2010.
If any further information required kindly revert back.
I really appreciate your co-operation on this.
@ -107,7 +107,7 @@
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="model_id" ref="crm.model_crm_lead"/>
<field eval="0" name="user_signature"/>
<field name="body_text">Hello, We have very good offer that might suit you.
<field name="body">Hello, We have very good offer that might suit you.
For our silver partners,We are paid technical training on june,2010.
If any further information required kindly revert back.
I really appreciate your co-operation on this.
@ -122,7 +122,7 @@
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="model_id" ref="crm.model_crm_lead"/>
<field eval="0" name="user_signature"/>
<field name="body_text">Hello, We have very good offer that might suit you.
<field name="body">Hello, We have very good offer that might suit you.
For our silver partners,We are offering Gold partnership.
If any further information required kindly revert back.
I really appreciate your co-operation on this.
@ -137,7 +137,7 @@
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
<field name="model_id" ref="crm.model_crm_lead"/>
<field eval="0" name="user_signature"/>
<field name="body_text">Hello, Thanks for showing intrest and for subscribing to technical training.If any further information required kindly revert back.I really appreciate your co-operation on this.
<field name="body">Hello, Thanks for showing intrest and for subscribing to technical training.If any further information required kindly revert back.I really appreciate your co-operation on this.
Regards,OpenERP Team,</field>
<field name="name">For subscribing to technical training</field>
</record>

View File

@ -132,7 +132,7 @@ class plugin_handler(osv.osv_memory):
return ('res.partner', partner_id, url)
# Specific to outlook rfc822 is not available so we split in arguments headerd,body,attachemnts
def push_message_outlook(self, cr, uid, model, headers,res_id=0 ,body_text=False, body_html=False, attachments=False):
def push_message_outlook(self, cr, uid, model, headers,res_id=0 ,body=False, body_html=False, attachments=False):
# ----------------------------------------
# solution 1
# construct a fake rfc822 from the separated arguement
@ -160,6 +160,6 @@ class plugin_handler(osv.osv_memory):
attach_ids.append(ir_attachment_obj.create(cr, uid, vals))
mail_ids = mail_message.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)])
if mail_ids:
ids = mail_message.write(cr, uid,mail_ids[0],{ 'attachment_ids': [(6, 0, attach_ids)],'body_text':body_text,'body_html':body_html})
ids = mail_message.write(cr, uid,mail_ids[0],{ 'attachment_ids': [(6, 0, attach_ids)],'body':body,'body_html':body_html})
url = self._make_url(cr, uid, res_id, model)
return (model, res_id, url)

View File

@ -454,7 +454,7 @@ class project_issue(base_stage, osv.osv):
custom_values.update({
'name': msg.get('subject') or _("No Subject"),
'description': msg.get('body_text'),
'description': msg.get('body'),
'email_from': msg.get('from'),
'email_cc': msg.get('cc'),
'user_id': False,
@ -476,16 +476,16 @@ class project_issue(base_stage, osv.osv):
if update_vals is None: update_vals = {}
# Update doc values according to the message
update_vals['description'] = msg.get('body_text', '')
update_vals['description'] = msg.get('body', '')
if msg.get('priority'):
update_vals['priority'] = msg.get('priority')
# Parse 'body_text' to find values to update
# Parse 'body' to find values to update
maps = {
'cost': 'planned_cost',
'revenue': 'planned_revenue',
'probability': 'probability',
}
for line in msg.get('body_text', '').split('\n'):
for line in msg.get('body', '').split('\n'):
line = line.strip()
res = tools.misc.command_re.match(line)
if res and maps.get(res.group(1).lower(), False):

View File

@ -50,7 +50,7 @@ class project_tasks(osv.osv):
maps = {
'cost':'planned_hours',
}
for line in msg['body_text'].split('\n'):
for line in msg['body'].split('\n'):
line = line.strip()
res = tools.misc.command_re.match(line)
if res:

View File

@ -108,7 +108,7 @@
</div>
</div>
]]></field>
<field name="body_text"><![CDATA[
<field name="body"><![CDATA[
Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},
Here is a ${object.state in ('draft', 'sent') and 'request for quotation' or 'purchase order confirmation'} from ${object.company_id.name}:

View File

@ -1767,7 +1767,7 @@ msgid ""
msgstr ""
#. module: purchase
#: model:email.template,body_text:purchase.email_template_edi_purchase
#: model:email.template,body:purchase.email_template_edi_purchase
msgid ""
"\n"
"Hello${object.partner_address_id.name and ' ' or ''}${object."

View File

@ -126,7 +126,7 @@
</div>
</div>
]]></field>
<field name="body_text"><![CDATA[
<field name="body"><![CDATA[
Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},
Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from ${object.company_id.name}:

View File

@ -1112,7 +1112,7 @@ msgid "Document of the move to the output or to the customer."
msgstr ""
#. module: sale
#: model:email.template,body_text:sale.email_template_edi_sale
#: model:email.template,body:sale.email_template_edi_sale
msgid ""
"\n"
"Hello${object.partner_order_id.name and ' ' or ''}${object.partner_order_id."