-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
[MIG] email_template_qweb: Migration to 15.0 #1072
Conversation
dzungtran89
commented
Feb 20, 2023
- This PR superseds [15.0][MIG] email_template_qweb: Migration to 15.0 #904
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.
bc65249
to
71fdbcb
Compare
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.
Technically LG
if self.body_type == "qweb" and (not fields or "body_html" in fields): | ||
if self.body_type == "qweb_view" and ( | ||
not fields or "body_html" in fields | ||
): |
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.
can't you by now override https://github.com/odoo/odoo/blob/15.0/addons/mail/models/mail_render_mixin.py#L565 and just pass the value of body_type
in engine
?
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.
That actually renders a mail template, while this tries to take the predefined views to render the mail's body
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.
I know what the module is doing because I'm it's original author ;-)
But now I see this function insists on views with an xmlid for that case, so it's indeed not usable for our case
/ocabot migration email_template_qweb |
if self.body_type == "qweb" and (not fields or "body_html" in fields): | ||
if self.body_type == "qweb_view" and ( | ||
not fields or "body_html" in fields | ||
): |
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.
I know what the module is doing because I'm it's original author ;-)
But now I see this function insists on views with an xmlid for that case, so it's indeed not usable for our case
This PR has the |
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 821a307. Thanks a lot for contributing to OCA. ❤️ |