diff options
| author | Ivan Yelizariev <iel@odoo.com> | 2021-04-30 14:21:12 +0000 |
|---|---|---|
| committer | Ivan Yelizariev <iel@odoo.com> | 2021-04-30 14:21:12 +0000 |
| commit | 172b88fdd955ba591a9bdd5a93bf7285ce0e6520 (patch) | |
| tree | 4e1288d5d79795b56865a11a5e417e674219af2c /addons | |
| parent | 5bbc234d43a415be18fcfa42dad33b1577644719 (diff) | |
[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: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/attachment_indexation/models/ir_attachment.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/attachment_indexation/models/ir_attachment.py b/addons/attachment_indexation/models/ir_attachment.py index 05394e12698..c6017f010c8 100644 --- a/addons/attachment_indexation/models/ir_attachment.py +++ b/addons/attachment_indexation/models/ir_attachment.py @@ -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) |
