Skip to content

[18.0][FIX] sale_order_line_cancel: render chatter markup instead of escaping it - #4551

Open
divad1196 wants to merge 1 commit into
OCA:18.0from
camptocamp:fix_sale_order_line_cancel_message
Open

[18.0][FIX] sale_order_line_cancel: render chatter markup instead of escaping it#4551
divad1196 wants to merge 1 commit into
OCA:18.0from
camptocamp:fix_sale_order_line_cancel_message

Conversation

@divad1196

Copy link
Copy Markdown
Contributor

Odoo 18 requires Markup for html messages.
Otherwise, the text is just escaped and renders as raw text

…ng it

Odoo 18 requires ``Markup`` for html messages.
Otherwise, the text is just escaped and renders as raw text
@OCA-git-bot OCA-git-bot added series:18.0 mod:sale_order_line_cancel Module sale_order_line_cancel labels Aug 27, 2026
body=Markup(
self.env._("<b>%(product)s</b>: The order line has been canceled")
)
% {"product": line.product_id.display_name}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO you should keep this inside the env._()

@divad1196 divad1196 Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jbaudoux no, otherwise it becomes an attack vector because it won't be escaped properly.

EDIT: did you mean to also translate the product? If yes, I can change to
instead. This one is ok display_name already translated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

› otherwise it becomes an attack vector because it won't be escaped properly.

Ah yes indeed

@OCA-git-bot

Copy link
Copy Markdown
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). 🤖

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.

5 participants