now taking the parent if is td

This commit is contained in:
teodoralexandru@nexterp.ro 2021-01-22 12:50:38 +02:00 committed by AlvaroTForgeFlow
parent 7e70ceb67b
commit 136cbb18da

View File

@ -37,7 +37,10 @@ class MailRenderMixin(models.AbstractModel):
# anchor <a href odoo has a parent powered by that must be removed
parent.getparent().remove(parent)
else:
parent.remove(elem)
if parent.tag == 'td': # also here can be powerd by
parent.getparent().remove(parent)
else:
parent.remove(elem)
value = etree.tostring(tree, pretty_print=True, method="html")
if type(value) is str:
value = re.sub("[^(<)(</)]odoo", "", value, flags=re.IGNORECASE)