[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 <svs@odoo.com>
This commit is contained in:
yhu-odoo
2023-06-06 16:22:42 +02:00
parent 048f0a53c3
commit efbd51560e
+3 -3
View File
@@ -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