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

[MIG] email_template_qweb: Migration to 15.0 #1072

Merged
merged 32 commits into from
Mar 20, 2023

Conversation

dzungtran89
Copy link

lasley and others added 30 commits February 20, 2023 11:49
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.
Copy link
Contributor

@ivantodorovich ivantodorovich left a 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
):
Copy link
Member

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?

Copy link
Author

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

Copy link
Member

@hbrunn hbrunn Mar 20, 2023

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

@hbrunn
Copy link
Member

hbrunn commented Mar 20, 2023

/ocabot migration email_template_qweb

@OCA-git-bot OCA-git-bot added this to the 15.0 milestone Mar 20, 2023
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 20, 2023
36 tasks
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
):
Copy link
Member

@hbrunn hbrunn Mar 20, 2023

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

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@hbrunn
Copy link
Member

hbrunn commented Mar 20, 2023

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-1072-by-hbrunn-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ff22f48 into OCA:15.0 Mar 20, 2023
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 821a307. Thanks a lot for contributing to OCA. ❤️

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

Successfully merging this pull request may close these issues.