Skip to main content

Import simple PDF vendor bills

Project description

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

Contributors

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page