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

[17.0][FIX] purchase_request: Add Markup to messages #2569

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

victoralmau
Copy link
Member

@victoralmau victoralmau commented Feb 17, 2025

Add Markup to messages

Remove warning log
WARNING odoo odoo.addons.mail.models.mail_thread: Posting HTML message using body_is_html=True, use a Markup object instead (user: 1)

@Tecnativa

@pedrobaeza
Copy link
Member

It seems this is not adding value as the parameter is_html_body=True is doing the same. Am I wrong?

@victoralmau victoralmau force-pushed the 17.0-fix-purchase_request-misc branch from 71124cc to 4604707 Compare February 17, 2025 11:13
@victoralmau
Copy link
Member Author

I have updated the commit message and the description to indicate that it is to avoid the warning log.

@pedrobaeza
Copy link
Member

In general about the PR, isn't the parameter body_is_html=True doing the same as you are doing manually here?

@victoralmau
Copy link
Member Author

I think it is important to remember the reason for this PR, to remove the warning log for using body_is_html=True https://github.com/odoo/odoo/blob/17.0/addons/mail/models/mail_thread.py#L2118 https://github.com/odoo/odoo/blob/1c896c5da71b58b382269fe6cca556f4a61e4d5d/addons/mail/models/mail_thread.py#L2200 Actually done is to use Markup so I understand that the change is correct and nothing extra is needed.

@pedrobaeza
Copy link
Member

OK, didn't know, but you can now assure no injection through data fields with the advices given here.

@StefanRijnhart
Copy link
Member

Thanks for the update. You can squash commits because they are closely related.

Remove warning log
WARNING odoo odoo.addons.mail.models.mail_thread: Posting HTML message using body_is_html=True, use a Markup object instead (user: 1)

[IMP] purchase_request: Add html_escape to some message data
@victoralmau victoralmau force-pushed the 17.0-fix-purchase_request-misc branch from 5594146 to f7aaf7d Compare February 21, 2025 08:27
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-2569-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit e00a257 into OCA:17.0 Feb 21, 2025
9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 23656b4. 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.

4 participants