Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Odoo 9 mail template problems

By
j3st3r
on 12/3/15, 3:57 AM 763 views

I have a problem with sending email as a server action.

when I get new lead I wanna send email. I've done server action, but when I choose template "reminder to user" it doesn't send anything and I see this error:

Failed to load template u'\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043e \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u0435: ${object.id} from ${object.partner_id != False \u0438 object.partner_id.name or object.contact_name}'

Traceback (most recent call last):

File "/opt/odoo/addons/mail/models/mail_template.py", line 331, in render_template

template = mako_template_env.from_string(tools.ustr(template_txt))

File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 841, 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 554, in compile

self.handle_exception(exc_info, source_hint=source)

File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception

reraise(exc_type, exc_value, tb)

File "<unknown>", line 1, in template

TemplateSyntaxError: unexpected char u'\u0438' at 72


If I create my own template - it doesn't send anything and there is no any message in logs.


Can someone help me?

0
Anton Chepurov
On 9/1/16, 7:02 AM

You need to "un-translate" the template.

Settings > Email > Templates > search for "Reminder to User" template and open it > Edit > on the Subject field hit the blue translation button > in the Russian Translation Value change this (note the word in bold ):

Напоминание о кандидате: ${object.id} from ${object.partner_id != False и object.partner_id.name or object.contact_name}

to this:

Напоминание о кандидате: ${object.id} from ${object.partner_id != False and object.partner_id.name or object.contact_name}

This should solve the issue, although I haven't tried it myself.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/3/15, 3:57 AM
Seen: 763 times
Last updated: 9/1/16, 7:02 AM