[7.0] email_from in email templates ignored

Bug #1193283 reported by electro

This bug report was converted into a question: question #234829: [7.0] email_from in email templates ignored.

102
This bug affects 21 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Medium
OpenERP Publisher's Warranty Team

Bug Description

As is in the related bug (https://bugs.launchpad.net/openobject-addons/+bug/1171505) but here I'm talking about email_from field

When sending an email from the system using a template with a fixed From email address, this settings is ignored and the email_from used is always alias of current user and not the email address or field specified in the template.

to find this you can
1) change email template for sale order and file email_from field with some fiexed email
2) send a sale sale order by email to some of your addresses using previous modified template

You should recevive the sale order where sender is the address you had specified in the template but you will receive by yourself opener alias.

I've prepared a workaroud that's is working for me :

in email_template/wizard/mail_compose_message.py: Add email_from to filter list
in mail/mail_followers.py : change sender selection order
in mail/wizard/mail_compose_message.py: add email_from field from wizard.email_from
in mail/wizard/mail_compose_message_view.xml: add email_from field

This is not so nice solution because it will shows sender field always also for standard messaging view, may be changes should be done on some other view (template ?) anyway it's wath I can do now
regards

Revision history for this message
electro (electro1) wrote :
description: updated
electro (electro1)
description: updated
Revision history for this message
Michael Karrer (michaelkarrer81) wrote :

hm this one is a nasty one - i can confirm it on my system too

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Electro,

I have checked this issue on deep. The problem is comes from the email rendering, you have to just install python-jinja2 packages at your server. Then it will work fine.
Open the terminal and install the following package.

sudo apt-get install python-jinja2 (for ubuntu)
yum install python-jinja2 (for centOS)

Thank you!

Changed in openobject-addons:
status: Confirmed → Invalid
Revision history for this message
SpideySense (v-mike-g) wrote :

Hello,
I was having the same problem too. Changes to the From and Reply-To fields in email templates were being ignored. But, I did get it to work by restarting the OpenERP service. The next time I sent email, the the settings I changed to From & Reply-To were in effect.

Cheers!

Revision history for this message
PkLab.net (pklab) wrote :

Hi,
Really I've Package python-jinja2 already installed and latest version on centos but I'm having the same problem too.

For example if I send a quotation by email, than "Sales Order - Send by Email" template is used by default.

In this default template I've replaced default From Field "${object.user_id.email or ''}" with a fixed email addr like "<email address hidden>".

While I'm expecting to receive quotation from "<email address hidden>" I still receiving from the alias for the openerp user that has sent the quotation: object.user_id.email.

This also for reply-to field
This also after openerp restart.

thank you

Revision history for this message
Rodrigo Rodrigues da Silva (rodrigopitanga) wrote :

Same here. Neither email_from nor reply_to are taken from the template. The template settings for email_from and reply_to from the template should override any other setting (as it occurs with the message subject, for example).

Restarting the server or installing python-jinja2 (it was already installed, actually) didn't work.

OpenERP version: 7.0-20131002-231025-1 (from OpenERP SA nightly .deb channel)
Jinja2 version: 2.5.5-1

Revision history for this message
l_olivier (SO Conseil) (soconseil) wrote :

I confirm the bug is still there (with jinja2 and latest stable sources installed)
Seems to be corrected in trunk (but I noticed a lot of changes in all mail et and email_template code)

Revision history for this message
Cats&Dogs (catsanddogs) wrote :

Hello,

I also confirm this bug is still present.
Stuck with it for weeks now, have to escalate it for an ongoing project...

Changed in openobject-addons:
status: Invalid → New
assignee: OpenERP R&D Addons Team 1 (openerp-dev-addons1) → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Ferdinand (office-chricar) wrote :
Revision history for this message
Jean-Marc Vandel (jmv) wrote :

Isn't this bug a duplicate of Bug #1171505 ???

Revision history for this message
MJR IT (mjrit) wrote :

we have the same problem, by sending automated invoices and orders with default supply E-MAil. We have the users E-MAil adress instead of the default supply-Team E-Mail from the template-field.
With this Problem our Signaturmanager will not work too :-(

I check the Version of OpenERP from 05.03.2014 and updated the ADDON but nothing happend.

Today I check lunchpad, But there is no Bugfix or an example who to fix it.

System:
OS/BS: MS Widnows
Version: OpenERP V7

Revision history for this message
l_olivier (SO Conseil) (soconseil) wrote :

Hi all,

thought this bug was solved weeks ago...
Here is a solution I wrote (in a specific module) to send an email in hr_recruitment/hr_applicant, using an email_template
Context :
When an applicant is refused, I created a button (see code in attached file) in the applicant form that allows to send an email based on a template.
module_name = name of the specific module
email_template_name = name of the template

Actually, we just use the template to get the informations (email_from, body,...) and then create the mail.
This way, the email_from is the one defined in the template and (bonus!) the email_to, extract from the applicant mail, is correctly formatted (it was not when I worked on it, see bug #1163790 ).

The bad news :
After the mail is created, it does not open. However, it is visible in the mail pending list (Configuration/Technical/email/email) and can be modified there.
The attachments of the template are not managed.

This code is not a patch, but it makes the system working as expected in this case.

Hope it helps.
Regards

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.