diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-01-31 16:59:58 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-01-31 16:59:58 +0100 |
| commit | f927c68ddbe4dccbdd0174019d6028d30b0d8058 (patch) | |
| tree | af24ebffe8241ee0c6ec9c911f2fe15f54237bcc /addons/attachment_indexation | |
| parent | 24ba5ae276a7c25cdcd4d2db2e17e032cfa7e52a (diff) | |
| parent | cb8fefa8999bd0056c2191edbdbbb85918d221da (diff) | |
[MERGE] forward port branch 12.0 up to cb8fefa8999
Diffstat (limited to 'addons/attachment_indexation')
| -rw-r--r-- | addons/attachment_indexation/models/ir_attachment.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/attachment_indexation/models/ir_attachment.py b/addons/attachment_indexation/models/ir_attachment.py index 2bc6aee234d..bdc4559e893 100644 --- a/addons/attachment_indexation/models/ir_attachment.py +++ b/addons/attachment_indexation/models/ir_attachment.py @@ -9,7 +9,7 @@ import zipfile from odoo import api, models _logger = logging.getLogger(__name__) -FTYPES = ['docx', 'pptx', 'xlsx', 'opendoc', 'pdf'] +FTYPES = ['docx', 'pptx', 'xlsx', 'opendoc'] def textToString(element): buff = u"" @@ -92,6 +92,9 @@ class IrAttachment(models.Model): def _index_pdf(self, bin_data): '''Index PDF documents''' + # extractText gives very bad results for indexing, hence we don't index PDF anymore. A + # better alternative is probably PDFMiner.six, but not for stable. + # See POC at https://github.com/odoo/odoo/pull/27568. buf = u"" if bin_data.startswith(b'%PDF-'): f = io.BytesIO(bin_data) |
