From efbd51560ec18a4965f6b86fbf551933c150f043 Mon Sep 17 00:00:00 2001 From: yhu-odoo Date: Mon, 22 May 2023 12:21:48 +0000 Subject: [PATCH] [FIX] purchase: join() result is not Markup object When Markup objects are joined by a str, the result will be a str. So, here: https://github.com/odoo/odoo/blob/5f3db6683ab191cb68af4c8d6bb2e86a5b114ee1/addons/purchase/models/account_invoice.py#L137 altought refs is all markup objects, join will return a normal str object that will be escaped. To fix, we join them by markup object. closes odoo/odoo#122268 X-original-commit: cc4a50091e540ddcc8b46ee77277bd53e634d536 Signed-off-by: Steve Van Essche --- addons/purchase/models/account_invoice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py index f7d75dc326f..a614c31f635 100644 --- a/addons/purchase/models/account_invoice.py +++ b/addons/purchase/models/account_invoice.py @@ -3,7 +3,7 @@ import difflib import logging import time -from markupsafe import escape +from markupsafe import Markup from odoo import api, fields, models, Command, _ @@ -134,7 +134,7 @@ class AccountMove(models.Model): if not purchases: continue refs = [purchase._get_html_link() for purchase in purchases] - message = escape(_("This vendor bill has been created from: %s")) % ','.join(refs) + message = _("This vendor bill has been created from: ") + Markup(',').join(refs) move.message_post(body=message) return moves @@ -149,7 +149,7 @@ class AccountMove(models.Model): diff_purchases = new_purchases - old_purchases[i] if diff_purchases: refs = [purchase._get_html_link() for purchase in diff_purchases] - message = escape(_("This vendor bill has been modified from: %s")) % ','.join(refs) + message = _("This vendor bill has been modified from: ") + Markup(',').join(refs) move.message_post(body=message) return res