[FIX] snailmail: Object of type bytes is not JSON serializable
Sending a letter resulted systematically in an error due to the insertion of the binary of the PDF in the JSON sent to IAP-services. closes odoo/odoo#29880
This commit is contained in:
@@ -165,12 +165,12 @@ class SnailmailLetter(models.Model):
|
||||
else:
|
||||
# adding the web logo from the company for future possible customization
|
||||
document.update({
|
||||
'company_logo': letter.company_id.logo_web,
|
||||
'company_logo': letter.company_id.logo_web.decode('utf-8'),
|
||||
})
|
||||
attachment = letter._fetch_attachment()
|
||||
if attachment:
|
||||
document.update({
|
||||
'pdf_bin': route == 'print' and attachment.datas,
|
||||
'pdf_bin': route == 'print' and attachment.datas.decode('utf-8'),
|
||||
'pages': route == 'estimate' and self._count_pages_pdf(base64.b64decode(attachment.datas)),
|
||||
})
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user