summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-12-11 16:54:35 +0100
committerThibault Delavallée <tde@openerp.com>2012-12-11 16:54:35 +0100
commit023783324077937517a8fab476a3a5dbee5ed535 (patch)
tree9360eb36a5c6c28665bf4d52e551c9cbfc04634f
parent3a1e0059a2d56fc92ac50fb0fd70685c5bdf176b (diff)
[FIX] mail.compose.message: fixed rendering when no template is chosen in the selection box; also cleaned display of recipients when using the wizard in mass mailing mode.
bzr revid: tde@openerp.com-20121211155435-l5s9lpghpxw8bi9o
-rw-r--r--addons/email_template/wizard/mail_compose_message.py12
-rw-r--r--addons/mail/wizard/mail_compose_message_view.xml7
2 files changed, 11 insertions, 8 deletions
diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py
index 168d93cdbe5..ad30b3817f5 100644
--- a/addons/email_template/wizard/mail_compose_message.py
+++ b/addons/email_template/wizard/mail_compose_message.py
@@ -68,7 +68,7 @@ class mail_compose_message(osv.TransientModel):
values = self.pool.get('email.template').read(cr, uid, template_id, ['subject', 'body_html'], context)
values.pop('id')
elif template_id:
- # FIXME odo: change the mail generation to avoid attachment duplication
+ # FIXME odo: change the mail generation to avoid attachment duplication
values = self.generate_email_for_composer(cr, uid, template_id, res_id, context=context)
# transform attachments into attachment_ids
values['attachment_ids'] = []
@@ -142,12 +142,12 @@ class mail_compose_message(osv.TransientModel):
return values
def render_message(self, cr, uid, wizard, res_id, context=None):
- """ Generate an email from the template for given (model, res_id) pair.
- This method is meant to be inherited by email_template that will
- produce a more complete dictionary, with email_to, ...
- """
+ """ Override to handle templates. """
# generate the composer email
- values = self.generate_email_for_composer(cr, uid, wizard.template_id, res_id, context=context)
+ if wizard.template_id:
+ values = self.generate_email_for_composer(cr, uid, wizard.template_id, res_id, context=context)
+ else:
+ values = {}
# get values to return
email_dict = super(mail_compose_message, self).render_message(cr, uid, wizard, res_id, context)
email_dict.update(values)
diff --git a/addons/mail/wizard/mail_compose_message_view.xml b/addons/mail/wizard/mail_compose_message_view.xml
index 57fc0aaf729..c0b329690e3 100644
--- a/addons/mail/wizard/mail_compose_message_view.xml
+++ b/addons/mail/wizard/mail_compose_message_view.xml
@@ -15,14 +15,17 @@
<!-- visible wizard -->
<label for="partner_ids" string="Recipients"/>
<div>
- <span attrs="{'invisible':[('model', '=', False)]}">
+ <span attrs="{'invisible':['|', ('model', '=', False), ('composition_mode', '!=', 'mass_mail')]}">
+ Followers of selected items and
+ </span>
+ <span attrs="{'invisible':['|', ('model', '=', False), ('composition_mode', '=', 'mass_mail')]}">
Followers of
<field name="record_name" readonly="1" class="oe_inline"
attrs="{'invisible':[('model', '=', False)]}"/>
and
</span>
<field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
- context="{'force_email':True}" required="1"/>
+ context="{'force_email':True}"/>
</div>
<field name="subject" placeholder="Subject..."/>
</group>