Skip to content
Snippets Groups Projects
Commit 172b88fd authored by Ivan Yelizariev's avatar Ivan Yelizariev
Browse files

[FIX] attachment_indexation: fix error "cannot contain NUL (0x00)"


To reproduce:

* install python package ``pdfminer.six``
* install module attachment_indexation
* upload special attachment

BEFORE:

Error in client:

> TypeError: relatedTemporaryAttachments is not iterable

Error in logs:

> ValueError: A string literal cannot contain NUL (0x00) characters.

AFTER:

No errors

---

opw-2506038

closes odoo/odoo#70186

Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent 5bbc234d
No related branches found
No related tags found
No related merge requests found
......@@ -125,6 +125,6 @@ class IrAttachment(models.Model):
for ftype in FTYPES:
buf = getattr(self, '_index_%s' % ftype)(bin_data)
if buf:
return buf
return buf.replace('\x00', '')
return super(IrAttachment, self)._index(bin_data, mimetype)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment