Account Invoice Import Simple PDF

Import simple PDF vendor bills

Technical Name:
account_invoice_import_simple_pdf
Version:
14.0
License:
Author:
Akretion
  • Odoo Version

Account Invoice Import Simple PDF

Beta License: AGPL-3 OCA/edi Translate me on Weblate Try me on Runbot

This module is an extension of the module account_invoice_import: it adds support for simple PDF invoices i.e. PDF invoice that don't have an embedded XML file. This module has been developped to solve the drawbacks of the OCA module account_invoice_import_invoice2data ; its advantages are the following:

  • Possibility to add support for a new vendor without developper skills: the accountant can do it!
  • Adding support for a new vendor is faster.
  • More tolerance on vendor invoice layout changes.
  • Easier to install.

With this module, you can import all the invoices that you were able to import with the module account_invoice_import_invoice2data. In fact, this module uses the same design when importing a PDF vendor bill:

  1. raw text extraction of the PDF file,
  2. identify the partner using the VAT number (if the VAT number is present in the raw text extraction) or some keywords,
  3. use regular expressions (regex) to extract the data needed to create the vendor bill in Odoo (single line configuration).

The main difference with the OCA module account_invoice_import_invoice2data is that the regular expressions are auto-generated from the configuration made by the user in Odoo. No need to be a regex expert! But you can still write regex to extract some fields for some very specific needs.

The module can extract the following fields:

  • Total Amount with taxes
  • Total Untaxed Amount
  • Total Tax Amount
  • Invoice Date
  • Due Date
  • Start Date
  • End Date
  • Invoice Number
  • Description (for that field, you have to write a regex)

In this list, only 3 fields are required:

  • Invoice Date
  • 2 out of the 3 Amount fields (the 3rd can be deducted from the 2 others: Total Amount = Total Untaxed + Total Tax)

To take advantage of the fields Start Date and End Date, you need the OCA module account_invoice_start_end_dates from the account-closing project.

To know the full story behind the development of this module, read this blog post.

Table of contents

Installation

This module requires several Python libraries:

  • PyMuPDF which is a Python binding for MuPDF, a lightweight PDF toolkit/viewer/renderer published under the AGPL licence by the company Artifex Software
  • regex which is backward-compatible with the re module of the Python standard library, but has additional functionalities.
  • dateparser which is a powerful date parsing library.

If you use Debian (Bullseye or higher) or Ubuntu (20.04 or higher), run the following command:

sudo apt install python3-fitz python3-regex python3-dateparser

You can also install these Python librairies via pip:

sudo pip3 install --upgrade PyMuPDF regex dateparser

but beware that PyMuPDF is just a binding on MuPDF, so it will require MuPDF and all the development libs required to compile the binding. So, for PyMuPDF, it's much easier to install it via the packages of your Linux distribution (package name python3-fitz on Debian/Ubuntu, but the package name may be different in other distributions).

Configuration

You will find a full demonstration about how to configure and use this module in this screencast.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

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

Credits

Authors

  • Akretion

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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.

Current maintainer:

alexis-via

This module is part of the OCA/edi project on GitHub.

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

This is a preview of the recently viewed products by the user.
Once the user has seen at least one product this snippet will be visible.

Recently viewed Products