-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
[17.0][MIG] email_template_qweb #1361
base: 17.0
Are you sure you want to change the base?
Conversation
If the result is of type unicode, render method encodes it in utf-8. We need to decode it in that case so that the rendering results correct.
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Currently translated at 88.9% (8 of 9 strings) Translation: social-12.0/social-12.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-12-0/social-12-0-email_template_qweb/pt_BR/
Currently translated at 100.0% (9 of 9 strings) Translation: social-12.0/social-12.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-12-0/social-12-0-email_template_qweb/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: social-13.0/social-13.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-13-0/social-13-0-email_template_qweb/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: social-13.0/social-13.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-13-0/social-13-0-email_template_qweb/
Currently translated at 80.0% (8 of 10 strings) Translation: social-14.0/social-14.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-14-0/social-14-0-email_template_qweb/fr/
Currently translated at 76.9% (10 of 13 strings) Translation: social-14.0/social-14.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-14-0/social-14-0-email_template_qweb/fr_FR/
Translations were broken, things hav changed in 14.0 and we need to call `_classify_per_lang` method to get the right lang, and use it to render the content.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: social-16.0/social-16.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-email_template_qweb/
Currently translated at 63.6% (7 of 11 strings) Translation: social-16.0/social-16.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-email_template_qweb/it/
Currently translated at 100.0% (11 of 11 strings) Translation: social-16.0/social-16.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-email_template_qweb/es/
Currently translated at 63.6% (7 of 11 strings) Translation: social-16.0/social-16.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-email_template_qweb/it/
Currently translated at 100.0% (11 of 11 strings) Translation: social-16.0/social-16.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-email_template_qweb/it/
Currently translated at 100.0% (11 of 11 strings) Translation: social-16.0/social-16.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-email_template_qweb/it/
Currently translated at 100.0% (11 of 11 strings) Translation: social-16.0/social-16.0-email_template_qweb Translate-URL: https://translation.odoo-community.org/projects/social-16-0/social-16-0-email_template_qweb/pt_BR/
708f3e2
to
4c4c80b
Compare
/ocabot migration email_template_qweb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the rest, LGTM 👍🏿
4c4c80b
to
912b94e
Compare
While it works fine in some contexts it doesn't work in this scenario:
The reason being is this:
This line is the culprit: template_fname contains "body_html" However that attribute is not defined in data XML so it returns with no body being rendered. This usecase used to work in 16.0 |
custom_context = { | ||
"object": record, | ||
"email_template": self, | ||
"format_datetime": lambda dt, | ||
tz=False, | ||
dt_format=False, | ||
lang_code=False: format_datetime( | ||
self.env, dt, tz, dt_format, lang_code | ||
), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom_context = { | |
"object": record, | |
"email_template": self, | |
"format_datetime": lambda dt, | |
tz=False, | |
dt_format=False, | |
lang_code=False: format_datetime( | |
self.env, dt, tz, dt_format, lang_code | |
), | |
} | |
custom_context = self._render_eval_context() | |
custom_context.update( | |
{ | |
"object": record, | |
"email_template": self, | |
"format_datetime": lambda dt, tz=False, dt_format=False, lang_code=False: format_datetime( | |
self.env, dt, tz, dt_format, lang_code | |
), | |
} | |
) |
This is akin to #1249
I see 2 possible fixes here:
Any ideas? Maybe @pedrobaeza ? |
Check where |
Thanks for quick reply but I am not sure I follow :-( For common templates it is filled in like this: https://github.com/odoo/odoo/blob/aff187f814998f4825da25f273eacef724686da3/addons/sale/data/mail_template_data.xml#L11-L41 In the _compute_body method it asks for "body_html" exactly. So I fail to see how to feed the result QWeb render to it... |
Well, I didn't know as well the internals, but it seems the |
This modules is not needed anymore. See #1480 |
ops, this is still v17 not v18. Sorry... However, as is not merged yet, we could evaluate if we can get rid of it already in v17. |
Standard Migration
@ForgeFlow