Hi,
I want to send an html report as notification email with a pdf report attached when an invoice is posted. I already created the necessary reports and trigger.
Now the problem is, the custom _execute()
method of account.invoice
turns all data into bytes-like objects which is a problem for the html2text
converter in the get_email()
function of the html report.
File "/tryton/trytond/trytond/report/report.py", line 615, in get_email
content_text = converter.handle(content)
File "/tryton/lib/python3.13/site-packages/html2text/__init__.py", line 149, in handle
self.feed(data)
~~~~~~~~~^^^^^^
File "/tryton/lib/python3.13/site-packages/html2text/__init__.py", line 144, in feed
data = data.replace("</' + 'script>", "</ignore>")
TypeError: a bytes-like object is required, not 'str'
What could I do here? Also, in general, if I have more than one report for my invoice, are they all cached separately? Because it seems like whichever is created first fills the cache.
Thanks for your help.