Skip to content

Commit

Permalink
Merge PR #1595 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 14, 2025
2 parents 8a0f8fd + deb52b4 commit 49f16e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mail_debrand/models/mail_render_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ def remove_href_odoo(self, value, to_keep=None):
has_dev_odoo_link = re.search(
r"<a\s(.*)dev\.odoo\.com", value, flags=re.IGNORECASE
)
has_odoo_link = re.search(r"<a\s(.*)odoo\.com", value, flags=re.IGNORECASE)
has_odoo_link = re.search(r"<a\s(.*)www\.odoo\.com", value, flags=re.IGNORECASE)
if has_odoo_link and not has_dev_odoo_link:
# We don't want to change what was explicitly added in the message body,
# so we will only change what is before and after it.
if to_keep:
value = value.replace(to_keep, "<body_msg></body_msg>")
tree = html.fromstring(value)
odoo_anchors = tree.xpath('//a[contains(@href,"odoo.com")]')
odoo_anchors = tree.xpath('//a[contains(@href,"www.odoo.com")]')
for elem in odoo_anchors:
parent = elem.getparent()
# Remove "Powered by", "using" etc.
Expand Down

0 comments on commit 49f16e5

Please sign in to comment.