Initial commit
This commit is contained in:
commit
e929db2e35
4
__init__.py
Normal file
4
__init__.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from . import models
|
18
__manifest__.py
Normal file
18
__manifest__.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
{
|
||||||
|
'name': 'Attachments List and Document Indexation',
|
||||||
|
'version': '2.1',
|
||||||
|
'category': 'Hidden/Tools',
|
||||||
|
'description': """
|
||||||
|
Attachments list and document indexation
|
||||||
|
========================================
|
||||||
|
* Show attachment on the top of the forms
|
||||||
|
* Document Indexation: odt, pdf, xlsx, docx
|
||||||
|
|
||||||
|
The `pdfminer.six` Python library has to be installed in order to index PDF files
|
||||||
|
""",
|
||||||
|
'depends': ['web'],
|
||||||
|
'installable': True,
|
||||||
|
'license': 'LGPL-3',
|
||||||
|
}
|
25
i18n/ar.po
Normal file
25
i18n/ar.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Arabic (https://www.transifex.com/odoo/teams/41243/ar/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: ar\n"
|
||||||
|
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "مرفق"
|
21
i18n/attachment_indexation.pot
Normal file
21
i18n/attachment_indexation.pot
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 17.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2023-10-26 21:55+0000\n"
|
||||||
|
"PO-Revision-Date: 2023-10-26 21:55+0000\n"
|
||||||
|
"Last-Translator: \n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: \n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr ""
|
25
i18n/cs.po
Normal file
25
i18n/cs.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# trendspotter <j.podhorecky@volny.cz>, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: trendspotter <j.podhorecky@volny.cz>, 2019\n"
|
||||||
|
"Language-Team: Czech (https://www.transifex.com/odoo/teams/41243/cs/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: cs\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Příloha"
|
25
i18n/da.po
Normal file
25
i18n/da.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Sanne Kristensen <sanne@vkdata.dk>, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Sanne Kristensen <sanne@vkdata.dk>, 2019\n"
|
||||||
|
"Language-Team: Danish (https://www.transifex.com/odoo/teams/41243/da/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: da\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Vedhæftning"
|
25
i18n/de.po
Normal file
25
i18n/de.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: German (https://www.transifex.com/odoo/teams/41243/de/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: de\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Dateianhang"
|
25
i18n/es.po
Normal file
25
i18n/es.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Spanish (https://www.transifex.com/odoo/teams/41243/es/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: es\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Adjunto"
|
25
i18n/fr.po
Normal file
25
i18n/fr.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: French (https://www.transifex.com/odoo/teams/41243/fr/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Pièce jointe"
|
25
i18n/he.po
Normal file
25
i18n/he.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# ExcaliberX <excaliberx@gmail.com>, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: ExcaliberX <excaliberx@gmail.com>, 2019\n"
|
||||||
|
"Language-Team: Hebrew (https://www.transifex.com/odoo/teams/41243/he/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: he\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "קובץ מצורף"
|
25
i18n/hr.po
Normal file
25
i18n/hr.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Croatian (https://www.transifex.com/odoo/teams/41243/hr/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: hr\n"
|
||||||
|
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Prilog"
|
25
i18n/hu.po
Normal file
25
i18n/hu.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Hungarian (https://www.transifex.com/odoo/teams/41243/hu/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: hu\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Melléklet"
|
25
i18n/it.po
Normal file
25
i18n/it.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Paolo Valier, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Paolo Valier, 2019\n"
|
||||||
|
"Language-Team: Italian (https://www.transifex.com/odoo/teams/41243/it/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: it\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Allegato"
|
21
i18n/lb.po
Normal file
21
i18n/lb.po
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Language-Team: Luxembourgish (https://www.transifex.com/odoo/teams/41243/lb/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: lb\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr ""
|
25
i18n/lt.po
Normal file
25
i18n/lt.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Linas Versada <linaskrisiukenas@gmail.com>, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Linas Versada <linaskrisiukenas@gmail.com>, 2019\n"
|
||||||
|
"Language-Team: Lithuanian (https://www.transifex.com/odoo/teams/41243/lt/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: lt\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Prisegtukas"
|
25
i18n/mn.po
Normal file
25
i18n/mn.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Mongolian (https://www.transifex.com/odoo/teams/41243/mn/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: mn\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Хавсралт"
|
25
i18n/nb.po
Normal file
25
i18n/nb.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Norwegian Bokmål (https://www.transifex.com/odoo/teams/41243/nb/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: nb\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Vedlegg"
|
25
i18n/nl.po
Normal file
25
i18n/nl.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Dutch (https://www.transifex.com/odoo/teams/41243/nl/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: nl\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Bijlage"
|
25
i18n/pl.po
Normal file
25
i18n/pl.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Polish (https://www.transifex.com/odoo/teams/41243/pl/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: pl\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Załącznik"
|
21
i18n/pt.po
Normal file
21
i18n/pt.po
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Language-Team: Portuguese (https://www.transifex.com/odoo/teams/41243/pt/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: pt\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr ""
|
25
i18n/pt_BR.po
Normal file
25
i18n/pt_BR.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/odoo/teams/41243/pt_BR/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: pt_BR\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Anexo"
|
21
i18n/ro.po
Normal file
21
i18n/ro.po
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Language-Team: Romanian (https://www.transifex.com/odoo/teams/41243/ro/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: ro\n"
|
||||||
|
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr ""
|
23
i18n/ru.po
Normal file
23
i18n/ru.po
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 17.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2023-10-26 21:55+0000\n"
|
||||||
|
"PO-Revision-Date: 2024-01-30 15:14+0400\n"
|
||||||
|
"Last-Translator: \n"
|
||||||
|
"Language-Team: Russian (https://app.transifex.com/odoo/teams/41243/ru/)\n"
|
||||||
|
"Language: ru\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Вложение"
|
25
i18n/tr.po
Normal file
25
i18n/tr.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Turkish (https://www.transifex.com/odoo/teams/41243/tr/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: tr\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Ek"
|
25
i18n/uk.po
Normal file
25
i18n/uk.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Alina Lisnenko <alinasemeniuk1@gmail.com>, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Alina Lisnenko <alinasemeniuk1@gmail.com>, 2019\n"
|
||||||
|
"Language-Team: Ukrainian (https://www.transifex.com/odoo/teams/41243/uk/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: uk\n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Прикріплення"
|
25
i18n/vi.po
Normal file
25
i18n/vi.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Nancy Momoland <thanhnguyen.icsc@gmail.com>, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Nancy Momoland <thanhnguyen.icsc@gmail.com>, 2019\n"
|
||||||
|
"Language-Team: Vietnamese (https://www.transifex.com/odoo/teams/41243/vi/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: vi\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "Đính kèm"
|
25
i18n/zh_CN.po
Normal file
25
i18n/zh_CN.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Chinese (China) (https://www.transifex.com/odoo/teams/41243/zh_CN/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: zh_CN\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "附件"
|
25
i18n/zh_TW.po
Normal file
25
i18n/zh_TW.po
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * attachment_indexation
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Martin Trigaux, 2019
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server saas~12.2\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-03-20 14:18+0000\n"
|
||||||
|
"PO-Revision-Date: 2019-08-26 09:09+0000\n"
|
||||||
|
"Last-Translator: Martin Trigaux, 2019\n"
|
||||||
|
"Language-Team: Chinese (Taiwan) (https://www.transifex.com/odoo/teams/41243/zh_TW/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: zh_TW\n"
|
||||||
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||||
|
|
||||||
|
#. module: attachment_indexation
|
||||||
|
#: model:ir.model,name:attachment_indexation.model_ir_attachment
|
||||||
|
msgid "Attachment"
|
||||||
|
msgstr "附件"
|
4
models/__init__.py
Normal file
4
models/__init__.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
|
||||||
|
from . import ir_attachment
|
146
models/ir_attachment.py
Normal file
146
models/ir_attachment.py
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||||
|
import io
|
||||||
|
import logging
|
||||||
|
import xml.dom.minidom
|
||||||
|
import zipfile
|
||||||
|
|
||||||
|
from odoo import api, models
|
||||||
|
from odoo.tools.lru import LRU
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
try:
|
||||||
|
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
|
||||||
|
from pdfminer.converter import TextConverter
|
||||||
|
from pdfminer.pdfpage import PDFPage
|
||||||
|
except ImportError:
|
||||||
|
PDFResourceManager = PDFPageInterpreter = TextConverter = PDFPage = None
|
||||||
|
_logger.warning("Attachment indexation of PDF documents is unavailable because the 'pdfminer' Python library cannot be found on the system. "
|
||||||
|
"You may install it from https://pypi.org/project/pdfminer.six/ (e.g. `pip3 install pdfminer.six`)")
|
||||||
|
|
||||||
|
FTYPES = ['docx', 'pptx', 'xlsx', 'opendoc', 'pdf']
|
||||||
|
|
||||||
|
|
||||||
|
index_content_cache = LRU(1)
|
||||||
|
|
||||||
|
def textToString(element):
|
||||||
|
buff = u""
|
||||||
|
for node in element.childNodes:
|
||||||
|
if node.nodeType == xml.dom.Node.TEXT_NODE:
|
||||||
|
buff += node.nodeValue
|
||||||
|
elif node.nodeType == xml.dom.Node.ELEMENT_NODE:
|
||||||
|
buff += textToString(node)
|
||||||
|
return buff
|
||||||
|
|
||||||
|
|
||||||
|
class IrAttachment(models.Model):
|
||||||
|
_inherit = 'ir.attachment'
|
||||||
|
|
||||||
|
def _index_docx(self, bin_data):
|
||||||
|
'''Index Microsoft .docx documents'''
|
||||||
|
buf = u""
|
||||||
|
f = io.BytesIO(bin_data)
|
||||||
|
if zipfile.is_zipfile(f):
|
||||||
|
try:
|
||||||
|
zf = zipfile.ZipFile(f)
|
||||||
|
content = xml.dom.minidom.parseString(zf.read("word/document.xml"))
|
||||||
|
for val in ["w:p", "w:h", "text:list"]:
|
||||||
|
for element in content.getElementsByTagName(val):
|
||||||
|
buf += textToString(element) + "\n"
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return buf
|
||||||
|
|
||||||
|
def _index_pptx(self, bin_data):
|
||||||
|
'''Index Microsoft .pptx documents'''
|
||||||
|
|
||||||
|
buf = u""
|
||||||
|
f = io.BytesIO(bin_data)
|
||||||
|
if zipfile.is_zipfile(f):
|
||||||
|
try:
|
||||||
|
zf = zipfile.ZipFile(f)
|
||||||
|
zf_filelist = [x for x in zf.namelist() if x.startswith('ppt/slides/slide')]
|
||||||
|
for i in range(1, len(zf_filelist) + 1):
|
||||||
|
content = xml.dom.minidom.parseString(zf.read('ppt/slides/slide%s.xml' % i))
|
||||||
|
for val in ["a:t"]:
|
||||||
|
for element in content.getElementsByTagName(val):
|
||||||
|
buf += textToString(element) + "\n"
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return buf
|
||||||
|
|
||||||
|
def _index_xlsx(self, bin_data):
|
||||||
|
'''Index Microsoft .xlsx documents'''
|
||||||
|
|
||||||
|
buf = u""
|
||||||
|
f = io.BytesIO(bin_data)
|
||||||
|
if zipfile.is_zipfile(f):
|
||||||
|
try:
|
||||||
|
zf = zipfile.ZipFile(f)
|
||||||
|
content = xml.dom.minidom.parseString(zf.read("xl/sharedStrings.xml"))
|
||||||
|
for val in ["t"]:
|
||||||
|
for element in content.getElementsByTagName(val):
|
||||||
|
buf += textToString(element) + "\n"
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return buf
|
||||||
|
|
||||||
|
def _index_opendoc(self, bin_data):
|
||||||
|
'''Index OpenDocument documents (.odt, .ods...)'''
|
||||||
|
|
||||||
|
buf = u""
|
||||||
|
f = io.BytesIO(bin_data)
|
||||||
|
if zipfile.is_zipfile(f):
|
||||||
|
try:
|
||||||
|
zf = zipfile.ZipFile(f)
|
||||||
|
content = xml.dom.minidom.parseString(zf.read("content.xml"))
|
||||||
|
for val in ["text:p", "text:h", "text:list"]:
|
||||||
|
for element in content.getElementsByTagName(val):
|
||||||
|
buf += textToString(element) + "\n"
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return buf
|
||||||
|
|
||||||
|
def _index_pdf(self, bin_data):
|
||||||
|
'''Index PDF documents'''
|
||||||
|
if PDFResourceManager is None:
|
||||||
|
return
|
||||||
|
buf = u""
|
||||||
|
if bin_data.startswith(b'%PDF-'):
|
||||||
|
f = io.BytesIO(bin_data)
|
||||||
|
try:
|
||||||
|
resource_manager = PDFResourceManager()
|
||||||
|
with io.StringIO() as content, TextConverter(resource_manager, content) as device:
|
||||||
|
logging.getLogger("pdfminer").setLevel(logging.CRITICAL)
|
||||||
|
interpreter = PDFPageInterpreter(resource_manager, device)
|
||||||
|
|
||||||
|
for page in PDFPage.get_pages(f):
|
||||||
|
interpreter.process_page(page)
|
||||||
|
|
||||||
|
buf = content.getvalue()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return buf
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _index(self, bin_data, mimetype, checksum=None):
|
||||||
|
if checksum:
|
||||||
|
cached_content = index_content_cache.get(checksum)
|
||||||
|
if cached_content:
|
||||||
|
return cached_content
|
||||||
|
res = False
|
||||||
|
for ftype in FTYPES:
|
||||||
|
buf = getattr(self, '_index_%s' % ftype)(bin_data)
|
||||||
|
if buf:
|
||||||
|
res = buf.replace('\x00', '')
|
||||||
|
break
|
||||||
|
|
||||||
|
res = res or super(IrAttachment, self)._index(bin_data, mimetype, checksum=checksum)
|
||||||
|
if checksum:
|
||||||
|
index_content_cache[checksum] = res
|
||||||
|
return res
|
||||||
|
|
||||||
|
def copy(self, default=None):
|
||||||
|
index_content_cache[self.checksum] = self.index_content
|
||||||
|
return super().copy(default=default)
|
3
tests/__init__.py
Normal file
3
tests/__init__.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import test_indexation
|
BIN
tests/files/test_content.pdf
Normal file
BIN
tests/files/test_content.pdf
Normal file
Binary file not shown.
24
tests/test_indexation.py
Normal file
24
tests/test_indexation.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from odoo.tests.common import TransactionCase, tagged
|
||||||
|
from odoo.tools.misc import file_open
|
||||||
|
from unittest import skipIf
|
||||||
|
import os
|
||||||
|
|
||||||
|
directory = os.path.dirname(__file__)
|
||||||
|
|
||||||
|
try:
|
||||||
|
from pdfminer.pdfinterp import PDFResourceManager
|
||||||
|
except ImportError:
|
||||||
|
PDFResourceManager = None
|
||||||
|
|
||||||
|
|
||||||
|
@tagged('post_install', '-at_install')
|
||||||
|
class TestCaseIndexation(TransactionCase):
|
||||||
|
|
||||||
|
@skipIf(PDFResourceManager is None, "pdfminer not installed")
|
||||||
|
def test_attachment_pdf_indexation(self):
|
||||||
|
with file_open(os.path.join(directory, 'files', 'test_content.pdf'), 'rb') as file:
|
||||||
|
pdf = file.read()
|
||||||
|
text = self.env['ir.attachment']._index(pdf, 'application/pdf')
|
||||||
|
self.assertEqual(text, 'TestContent!!\x0c', 'the index content should be correct')
|
Loading…
x
Reference in New Issue
Block a user