Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to render mako template value #4

Open
haylahi opened this issue Feb 23, 2013 · 1 comment
Open

Failed to render mako template value #4

haylahi opened this issue Feb 23, 2013 · 1 comment
Assignees

Comments

@haylahi
Copy link

haylahi commented Feb 23, 2013

Hi vaab,

To reproduce this error :
1- Go to menu -> Settings -> Email -> Template
2- Edit email template with ckeditor widgt (ex. Send order - send by email)
3 - Try to send an email with this template in qutotation form ; you receive this error in log:

openerp.addons.email_template.email_template: failed to render mako template value u'<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size:
Traceback (most recent call last):
File "/home/haylahi/workspace/OE_70/server/openerp/addons/email_template/email_template.py", line 98, in render_template
result = mako_template_env.from_string(template).render(variables)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 769, in from_string
return cls.from_code(self, self.compile(source), globals, None)
File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 493, in compile
self.handle_exception(exc_info, source_hint=source)
File "", line 4, in template
TemplateSyntaxError: unexpected char u'&' at 222

@vaab
Copy link
Member

vaab commented Feb 25, 2013

Hi, thank for you thorough usage of web_ckeditor.

I looked at your case, but it seems to me that it could be a bad idea to use web_ckeditor in these mail templates as they are not pure HTML (that's what CKEditor will produce), but mako templates -- which is a template language used to produce HTML. As I understand it, it seems to me foreseeable that issues will happen by doing that.

However, I tried to reproduce your bug, and I installed "Sale", modified the template, saved it, and used "Send a Mail" button in Quotation form, and it worked (and it is a surprise for me ;) ).

I'm using Chrome.

We are chasing a syntax error in the email template. Can you send me the body_html database content of your quotation sale ? You can find it in the "email_template" table in the openerp database.

Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants