odoo-addon-base-import-pdf-by-template


Nameodoo-addon-base-import-pdf-by-template JSON
Version 17.0.1.2.3.1 PyPI version JSON
download
home_pagehttps://github.com/OCA/edi
SummaryBase Import Pdf by Template
upload_time2025-02-19 02:48:53
maintainerNone
docs_urlNone
authorTecnativa, Odoo Community Association (OCA)
requires_python>=3.10
licenseAGPL-3
keywords
VCS
bugtrack_url
requirements dotty-dict factur-x phonenumbers pydifact pytz xmltodict
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===========================
Base Import Pdf by Template
===========================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:8c5b42f280dd06ee4097a70089ff37af28f91b9680960ff29342ce80b5de9d86
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fedi-lightgray.png?logo=github
    :target: https://github.com/OCA/edi/tree/17.0/base_import_pdf_by_template
    :alt: OCA/edi
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/edi-17-0/edi-17-0-base_import_pdf_by_template
    :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/edi&target_branch=17.0
    :alt: Try me on Runboat

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

This module allows you to import PDF files and generate records based on
the data contained in those PDF files. It also allows you to define a
pattern that indicates how to recognize and extract the data from the
PDF to generate a record.

**Table of contents**

.. contents::
   :local:

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

To configure a PDF document template for import, the first thing to do
is to have the document defined with a specific structure.

1. Go to Settings > Technical > Base Import PDF Simple > Templates
2. Create a new template by entering a characteristic name and the model
   on which the record will be generated.

..

   Fields to consider completing on template:

      - Main Model: model on which the record will be generated.
        Example: purchase.order
      - Child field: One2many field that will create records from
        selected template. Example: Order Lines (purchase.order)
      - Auto detect pattern: Define a characteristic pattern of the
        document so that it recognizes that it corresponds to the
        template we are creating. Need to use regular expression.
        Example: (?<=ESA79935607)[Ss]\*
      - Header Items: Complete this field if the template has a header
        table to extract information lines. Example:
        Reference,Quantity,Price
      - Company: Set the company that will use the template. If it is
        empty, template will apply for all companies set on the
        environment.

1. Add new lines.

..

   - Related model: When adding new line, the section where to locate
     the data; "header" which, as its name indicates, refers to the
     header of the document and "lines" refers to the structure of lines
     or table of the document.

   - Field: Map the field to be completed. Example: product

   - Pattern: Optional field to complete. Define pattern of the document
     so that it recognizes the place to get the field selected on PDF
     template. Need to use regular expression. Example: ([0-9]{7})
     [0-7]{1}

   - Value type:

     - Fixed: Select this value, if the field mapped will always have an
       specific value and not extract the information from template. In
       this case Pattern field must be empty.
     - Variable: Select variable to get the information from template.
       In this case, Pattern field must be completed.

   - For Value type "Variable" will appear extra fields to complete:

   - Search value: Indicates the field by which the value obtained in
     the PDF will be searched on the system.

   - Default value: If the search result is empty for the search value
     option, you can set default value to create a record and not
     getting error message.

   - Log distint value?: This option is useful when getting prices in
     order to compare prices inside system and prices obtained from PDF.
     This will create lines with prices obtained from the system but
     create log on chatter to see the differences obtained from PDF.

Check demo data to further information.

Usage
=====

This module allows to upload PDF files in any Odoo model. It processes
each of the files and converts it into a new record. Technically, the
pdf is transformed into text and that text is processed to create the
record. The module incorporates an option in actions 'Import records
(with template)' and Template configuration in order to recognized any
document structure.

Known issues / Roadmap
======================

- Add operator in template lines (= or ilike)
- Simplify auto-detection (defining a text only to search the system
  should search the corresponding regular expression).
- Allow compatibility with registration process created from email alias
  (for purchase order for example).
- Remove error if some file is not auto-detected template, options:
  boolean (default option according to system parameter) to omit error
  for not found files or change process to 2 steps, auto-detect and show
  lines (each one with respect to a file) with template applied (similar
  to dms_auto_classification).
- Display a more readable error if there is an error in Preview process,
  example: wrong pattern. Message: "Please check template defined, some
  items are not correctly set".
- Add a progress bar (widget=“gauge”) in the import wizard process,
  useful if we import for example sales orders with 20 lines and thus
  know the progress.
- Add date_format model to define the specific formats.

Compatibility with csv, xls, etc:

- Separate much of the logic to new module base_import_simple that would
  contain the logic of templates, type of files (csv, excel, etc) in the
  templates and wizard and this module would depend on the other adding
  only what relates to PDF.
- The base module should take into account for each template whether
  each line is a new record or not, and start line (in case you want to
  omit any), only page 1 would be imported.
- The preview smart-btton would serve exactly the same purpose.
- In the case of csv and Excel that each record is a line, the document
  will NOT be attached to the record.
- If you indicate that each record is a line the column will be the key,
  otherwise you must specify to which line each line of the template
  refers.
- In the case of csv it will try to auto-detect the lines and columns
  (no need to complicate delimiters configuration).
- The menu "Import PDF" of the favorite menu would become "Import file",
  and the allowed file extensions would be those obtained from a method
  (it would be extended by other modules that add other formats such as
  PDF).
- Add queue_job_base_import_simple module to process everything by
  queues (example: Excel with hundreds of lines, each one a record).

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/edi/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/edi/issues/new?body=module:%20base_import_pdf_by_template%0Aversion:%2017.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/edi <https://github.com/OCA/edi/tree/17.0/base_import_pdf_by_template>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OCA/edi",
    "name": "odoo-addon-base-import-pdf-by-template",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Tecnativa, Odoo Community Association (OCA)",
    "author_email": "support@odoo-community.org",
    "download_url": null,
    "platform": null,
    "description": "===========================\nBase Import Pdf by Template\n===========================\n\n.. \n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! This file is generated by oca-gen-addon-readme !!\n   !! changes will be overwritten.                   !!\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! source digest: sha256:8c5b42f280dd06ee4097a70089ff37af28f91b9680960ff29342ce80b5de9d86\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n    :target: https://odoo-community.org/page/development-status\n    :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png\n    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html\n    :alt: License: AGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi-lightgray.png?logo=github\n    :target: https://github.com/OCA/edi/tree/17.0/base_import_pdf_by_template\n    :alt: OCA/edi\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n    :target: https://translation.odoo-community.org/projects/edi-17-0/edi-17-0-base_import_pdf_by_template\n    :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png\n    :target: https://runboat.odoo-community.org/builds?repo=OCA/edi&target_branch=17.0\n    :alt: Try me on Runboat\n\n|badge1| |badge2| |badge3| |badge4| |badge5|\n\nThis module allows you to import PDF files and generate records based on\nthe data contained in those PDF files. It also allows you to define a\npattern that indicates how to recognize and extract the data from the\nPDF to generate a record.\n\n**Table of contents**\n\n.. contents::\n   :local:\n\nConfiguration\n=============\n\nTo configure a PDF document template for import, the first thing to do\nis to have the document defined with a specific structure.\n\n1. Go to Settings > Technical > Base Import PDF Simple > Templates\n2. Create a new template by entering a characteristic name and the model\n   on which the record will be generated.\n\n..\n\n   Fields to consider completing on template:\n\n      - Main Model: model on which the record will be generated.\n        Example: purchase.order\n      - Child field: One2many field that will create records from\n        selected template. Example: Order Lines (purchase.order)\n      - Auto detect pattern: Define a characteristic pattern of the\n        document so that it recognizes that it corresponds to the\n        template we are creating. Need to use regular expression.\n        Example: (?<=ESA79935607)[Ss]\\*\n      - Header Items: Complete this field if the template has a header\n        table to extract information lines. Example:\n        Reference,Quantity,Price\n      - Company: Set the company that will use the template. If it is\n        empty, template will apply for all companies set on the\n        environment.\n\n1. Add new lines.\n\n..\n\n   - Related model: When adding new line, the section where to locate\n     the data; \"header\" which, as its name indicates, refers to the\n     header of the document and \"lines\" refers to the structure of lines\n     or table of the document.\n\n   - Field: Map the field to be completed. Example: product\n\n   - Pattern: Optional field to complete. Define pattern of the document\n     so that it recognizes the place to get the field selected on PDF\n     template. Need to use regular expression. Example: ([0-9]{7})\n     [0-7]{1}\n\n   - Value type:\n\n     - Fixed: Select this value, if the field mapped will always have an\n       specific value and not extract the information from template. In\n       this case Pattern field must be empty.\n     - Variable: Select variable to get the information from template.\n       In this case, Pattern field must be completed.\n\n   - For Value type \"Variable\" will appear extra fields to complete:\n\n   - Search value: Indicates the field by which the value obtained in\n     the PDF will be searched on the system.\n\n   - Default value: If the search result is empty for the search value\n     option, you can set default value to create a record and not\n     getting error message.\n\n   - Log distint value?: This option is useful when getting prices in\n     order to compare prices inside system and prices obtained from PDF.\n     This will create lines with prices obtained from the system but\n     create log on chatter to see the differences obtained from PDF.\n\nCheck demo data to further information.\n\nUsage\n=====\n\nThis module allows to upload PDF files in any Odoo model. It processes\neach of the files and converts it into a new record. Technically, the\npdf is transformed into text and that text is processed to create the\nrecord. The module incorporates an option in actions 'Import records\n(with template)' and Template configuration in order to recognized any\ndocument structure.\n\nKnown issues / Roadmap\n======================\n\n- Add operator in template lines (= or ilike)\n- Simplify auto-detection (defining a text only to search the system\n  should search the corresponding regular expression).\n- Allow compatibility with registration process created from email alias\n  (for purchase order for example).\n- Remove error if some file is not auto-detected template, options:\n  boolean (default option according to system parameter) to omit error\n  for not found files or change process to 2 steps, auto-detect and show\n  lines (each one with respect to a file) with template applied (similar\n  to dms_auto_classification).\n- Display a more readable error if there is an error in Preview process,\n  example: wrong pattern. Message: \"Please check template defined, some\n  items are not correctly set\".\n- Add a progress bar (widget=\u201cgauge\u201d) in the import wizard process,\n  useful if we import for example sales orders with 20 lines and thus\n  know the progress.\n- Add date_format model to define the specific formats.\n\nCompatibility with csv, xls, etc:\n\n- Separate much of the logic to new module base_import_simple that would\n  contain the logic of templates, type of files (csv, excel, etc) in the\n  templates and wizard and this module would depend on the other adding\n  only what relates to PDF.\n- The base module should take into account for each template whether\n  each line is a new record or not, and start line (in case you want to\n  omit any), only page 1 would be imported.\n- The preview smart-btton would serve exactly the same purpose.\n- In the case of csv and Excel that each record is a line, the document\n  will NOT be attached to the record.\n- If you indicate that each record is a line the column will be the key,\n  otherwise you must specify to which line each line of the template\n  refers.\n- In the case of csv it will try to auto-detect the lines and columns\n  (no need to complicate delimiters configuration).\n- The menu \"Import PDF\" of the favorite menu would become \"Import file\",\n  and the allowed file extensions would be those obtained from a method\n  (it would be extended by other modules that add other formats such as\n  PDF).\n- Add queue_job_base_import_simple module to process everything by\n  queues (example: Excel with hundreds of lines, each one a record).\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/edi/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us to smash it by providing a detailed and welcomed\n`feedback <https://github.com/OCA/edi/issues/new?body=module:%20base_import_pdf_by_template%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n-------\n\n* Tecnativa\n\nContributors\n------------\n\n- `Tecnativa <https://www.tecnativa.com>`__:\n\n  - V\u00edctor Mart\u00ednez\n  - Pedro M. Baeza\n\nMaintainers\n-----------\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n   :alt: Odoo Community Association\n   :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\n.. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px\n    :target: https://github.com/victoralmau\n    :alt: victoralmau\n\nCurrent `maintainer <https://odoo-community.org/page/maintainer-role>`__:\n\n|maintainer-victoralmau| \n\nThis module is part of the `OCA/edi <https://github.com/OCA/edi/tree/17.0/base_import_pdf_by_template>`_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n",
    "bugtrack_url": null,
    "license": "AGPL-3",
    "summary": "Base Import Pdf by Template",
    "version": "17.0.1.2.3.1",
    "project_urls": {
        "Homepage": "https://github.com/OCA/edi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "85c86680a47f356de6b598a15d5d74c3c1c9f8edd0858d23cc5be1677d5784b9",
                "md5": "e28bfb6e82ece73d444d1306742c4eec",
                "sha256": "744cb97ebe257102922b96dcab46d485f4b74eeafd534990acefa375926855d7"
            },
            "downloads": -1,
            "filename": "odoo_addon_base_import_pdf_by_template-17.0.1.2.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e28bfb6e82ece73d444d1306742c4eec",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 71247,
            "upload_time": "2025-02-19T02:48:53",
            "upload_time_iso_8601": "2025-02-19T02:48:53.968597Z",
            "url": "https://files.pythonhosted.org/packages/85/c8/6680a47f356de6b598a15d5d74c3c1c9f8edd0858d23cc5be1677d5784b9/odoo_addon_base_import_pdf_by_template-17.0.1.2.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-19 02:48:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OCA",
    "github_project": "edi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "dotty-dict",
            "specs": []
        },
        {
            "name": "factur-x",
            "specs": [
                [
                    "<=",
                    "3.1"
                ]
            ]
        },
        {
            "name": "phonenumbers",
            "specs": []
        },
        {
            "name": "pydifact",
            "specs": []
        },
        {
            "name": "pytz",
            "specs": []
        },
        {
            "name": "xmltodict",
            "specs": []
        }
    ],
    "lcname": "odoo-addon-base-import-pdf-by-template"
}
        
Elapsed time: 4.31706s