Skip to content

Commit

Permalink
[ADD] dms_field_auto_classification: New module
Browse files Browse the repository at this point in the history
TT46805
  • Loading branch information
victoralmau committed Feb 8, 2024
1 parent 37a8d9e commit a763847
Show file tree
Hide file tree
Showing 24 changed files with 1,232 additions and 0 deletions.
111 changes: 111 additions & 0 deletions dms_field_auto_classification/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
======================================
Auto classification files to dms_field
======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4e053d2a90c6feb0d14abf8fd37839bbcc19b7dc15abf6270439a4a2b34350c5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdms-lightgray.png?logo=github
:target: https://github.com/OCA/dms/tree/15.0/dms_field_auto_classification
:alt: OCA/dms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/dms-15-0/dms-15-0-dms_field_auto_classification
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/dms&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Automatically classify files within a .zip file to the corresponding DMS directory(s) related to a record.

**Table of contents**

.. contents::
:local:

Configuration
=============

#. Go to `Documents / Configuration / Classification Templates` and create or edit a template.
#. You can set a model to which it is linked (res.partner for example).
#. You can define the details to indicate which field is referenced by the defined filename pattern.

Full example from res.partner:

Filename pattern: ([0-9]{8}[A-Z]).*.pdf
Details: VAT (field) and 0 (index)
Directory Pattern example 1: {0} > This will attempt to add the files to the directory linked to the partner with the VAT name.
Directory Pattern example 2: {0} / Misc > This will attempt to add the files to the "Misc" subdirectory linked to the partner with the VAT name.

Usage
=====

#. Go to `Documents / Auto Classification` and select a template and a .zip file.
#. Press the `Analyze` button
#. As many lines will be set as the number of files contained in the .zip file and apply the filename pattern.
#. The record to which they are related (res.partner for example) will be show on the lines.
#. Press the `Classify` button
#. The files (dms.file) will be created in the corresponding directories.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/dms/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/dms/issues/new?body=module:%20dms_field_auto_classification%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px
:target: https://github.com/victoralmau
:alt: victoralmau

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-victoralmau|

This module is part of the `OCA/dms <https://github.com/OCA/dms/tree/15.0/dms_field_auto_classification>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions dms_field_auto_classification/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
from . import wizards
19 changes: 19 additions & 0 deletions dms_field_auto_classification/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Auto classification files to dms_field",
"version": "15.0.1.0.0",
"category": "Document Management",
"website": "https://github.com/OCA/dms",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["dms_auto_classification", "dms_field"],
"installable": True,
"data": [
"security/ir.model.access.csv",
"views/dms_classification_template_views.xml",
"wizards/wizard_dms_classification_views.xml",
],
"demo": ["demo/dms_classification_template_demo.xml"],
"maintainers": ["victoralmau"],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record
id="dms_classification_template_partners"
model="dms.classification.template"
>
<field name="name">Partners template</field>
<field name="filename_pattern">([0-9]{8}[A-Z]).*.pdf</field>
<field name="model_id" ref="base.model_res_partner" />
<field name="directory_pattern">{0}</field>
</record>
<record
id="dms_classification_template_partners_detail_0"
model="dms.classification.template.detail"
>
<field name="parent_id" ref="dms_classification_template_partners" />
<field name="field_id" ref="base.field_res_partner__vat" />
<field name="index">0</field>
</record>
</odoo>
115 changes: 115 additions & 0 deletions dms_field_auto_classification/i18n/dms_field_auto_classification.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dms_field_auto_classification
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-23 12:22+0000\n"
"PO-Revision-Date: 2024-01-23 12:22+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: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__create_uid
msgid "Created by"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__create_date
msgid "Created on"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template__dms_directory_ids
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__dms_directory_ids
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_wizard_dms_classification_detail__dms_directory_ids
msgid "DMS Directories"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template__detail_ids
msgid "Details"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__display_name
msgid "Display Name"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model,name:dms_field_auto_classification.model_dms_classification_template
msgid "Dms Classification Template"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model,name:dms_field_auto_classification.model_dms_classification_template_detail
msgid "Dms Classification Template Detail"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__field_id
msgid "Field"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__id
msgid "ID"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__index
msgid "Index"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail____last_update
msgid "Last Modified on"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__write_uid
msgid "Last Updated by"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__write_date
msgid "Last Updated on"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template__model
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template__model_id
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__model_id
msgid "Model"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__parent_id
msgid "Parent"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_wizard_dms_classification_detail__record_ref
msgid "Record Referenced"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__sequence
msgid "Sequence"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_wizard_dms_classification_detail__template_id
msgid "Template"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model,name:dms_field_auto_classification.model_wizard_dms_classification_detail
msgid "Wizard Dms Classification Detail"
msgstr ""
117 changes: 117 additions & 0 deletions dms_field_auto_classification/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dms_field_auto_classification
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-23 12:22+0000\n"
"PO-Revision-Date: 2024-01-23 13:24+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__create_uid
msgid "Created by"
msgstr "Creado por"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__create_date
msgid "Created on"
msgstr "Creado el"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template__dms_directory_ids
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__dms_directory_ids
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_wizard_dms_classification_detail__dms_directory_ids
msgid "DMS Directories"
msgstr "Directorios DMS"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template__detail_ids
msgid "Details"
msgstr "Detalles"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__display_name
msgid "Display Name"
msgstr "Nombre a Mostrar"

#. module: dms_field_auto_classification
#: model:ir.model,name:dms_field_auto_classification.model_dms_classification_template
msgid "Dms Classification Template"
msgstr "Plantilla de clasificación Dms"

#. module: dms_field_auto_classification
#: model:ir.model,name:dms_field_auto_classification.model_dms_classification_template_detail
msgid "Dms Classification Template Detail"
msgstr ""

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__field_id
msgid "Field"
msgstr "Campo"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__id
msgid "ID"
msgstr "ID"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__index
msgid "Index"
msgstr "Índice"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__write_uid
msgid "Last Updated by"
msgstr "Actualizado por última vez por"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__write_date
msgid "Last Updated on"
msgstr "Última modificación el"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template__model
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template__model_id
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__model_id
msgid "Model"
msgstr "Modelo"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__parent_id
msgid "Parent"
msgstr "Padre"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_wizard_dms_classification_detail__record_ref
msgid "Record Referenced"
msgstr "Registro referenciado"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_dms_classification_template_detail__sequence
msgid "Sequence"
msgstr "Secuencia"

#. module: dms_field_auto_classification
#: model:ir.model.fields,field_description:dms_field_auto_classification.field_wizard_dms_classification_detail__template_id
msgid "Template"
msgstr "Plantilla"

#. module: dms_field_auto_classification
#: model:ir.model,name:dms_field_auto_classification.model_wizard_dms_classification_detail
msgid "Wizard Dms Classification Detail"
msgstr ""
3 changes: 3 additions & 0 deletions dms_field_auto_classification/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import dms_classification_template
Loading

0 comments on commit a763847

Please sign in to comment.