6.1 email_template when i make a html_template it don't work
Bug #1021185 reported by
walter salzmann
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Confirmed
|
Low
|
OpenERP R&D Addons Team 1 |
Bug Description
When i make a html-template and want to sent, for example from sale_order, it don't work.
The subtype that is always in the mail is plain and not html.
I have tested it on the current branch of openerp6.1.
description: | updated |
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1) |
importance: | Undecided → Low |
status: | New → Confirmed |
To post a comment you must log in.
I was trying to debug this bug with the limited knowledge of OpenERP I have. Might be useful information for someone to fix.
To give a context, the variable mail.subtype controls whether the mail should go out as plain text or html. The template when created, sets the right value of mail.subtype ('html'). When you compose a mail using the template in the wizard, the variable still has the right value (as observed in debug view).
However, I debugged the send_mail function in addons/ mail/wizard/ mail_compose_ message. py, and it looks like the mail.subtype element had been set to 'text' instead of 'html'. Somewhere between clicking "Send Button" and the program control reaching "send_mail", the value has been altered from 'html' to 'text'.
I am not sure what causes this change in variable value. My first hypothesis was that the variable has been changed while creating a copy of the mail object. I tried putting debug points in the copy functions but without fail.
For now, I have just hacked the code to convert the value of mail.subtype in code, but I am looking for cleaner solution.