[IMP] extract_api: Add bank statement documentation

- Updated documentation to include details on the new bank statement
extraction via OCR.
- Removed mention of unsupported discount, product, and unit features
from invoice_lines feature.

Task-3895452

closes odoo/documentation#11392

X-original-commit: 8c93ff790e
Signed-off-by: Joris Makauskis (jmak) <jmak@odoo.com>
This commit is contained in:
Joris Makauskis 2024-11-07 14:45:26 +00:00
parent 66f3b28309
commit 0548b3fb4b

View File

@ -2,13 +2,13 @@
Extract API Extract API
=========== ===========
Odoo provides a service to automate the processing of documents of type **invoices**, **expenses** Odoo provides a service to automate the processing of documents of type **invoices**, **bank statements**,
or **resumes**. **expenses** or **resumes**.
The service scans documents using an :abbr:`OCR (Optical Character Recognition)` engine and then The service scans documents using an :abbr:`OCR (Optical Character Recognition)` engine and then
uses :abbr:`AI(Artificial Intelligence)`-based algorithms to extract fields of interest such as the uses :abbr:`AI(Artificial Intelligence)`-based algorithms to extract fields of interest such as the
total, due date, or invoice lines for *invoices*, the total, date for *expenses*, total, due date, or invoice lines for *invoices*, the initial and final balances, the date for
or the name, email, phone number for *resumes*. *bank statements*, the total, date for *expenses*, or the name, email, phone number for *resumes*.
This service is a paid service. Each document processing will cost you one credit. This service is a paid service. Each document processing will cost you one credit.
Credits can be bought on `iap.odoo.com <https://iap.odoo.com/iap/in-app-services/259?sortby=date>`_. Credits can be bought on `iap.odoo.com <https://iap.odoo.com/iap/in-app-services/259?sortby=date>`_.
@ -32,7 +32,8 @@ Version
The version of the Extract API is specified in the route. The version of the Extract API is specified in the route.
The latest versions are: The latest versions are:
- invoices: 122 - invoices: 123
- bank statements: 100
- expenses: 132 - expenses: 132
- applicant: 102 - applicant: 102
@ -67,6 +68,7 @@ Routes
------ ------
- /api/extract/invoice/2/parse - /api/extract/invoice/2/parse
- /api/extract/bank_statement/1/parse
- /api/extract/expense/2/parse - /api/extract/expense/2/parse
- /api/extract/applicant/2/parse - /api/extract/applicant/2/parse
@ -213,6 +215,7 @@ Routes
------ ------
- /api/extract/invoice/2/get_result - /api/extract/invoice/2/get_result
- /api/extract/bank_statement/1/get_result
- /api/extract/expense/2/get_result - /api/extract/expense/2/get_result
- /api/extract/applicant/2/get_result - /api/extract/applicant/2/get_result
@ -382,7 +385,7 @@ Invoices are complex and can have a lot of different fields. The following table
list of all the fields we can extract from an invoice. list of all the fields we can extract from an invoice.
+-------------------------+------------------------------------------------------------------------+ +-------------------------+------------------------------------------------------------------------+
| Feature name | Specifities | | Feature name | Specificities |
+=========================+========================================================================+ +=========================+========================================================================+
| ``SWIFT_code`` | ``content`` is a dictionary encoded as a string. | | ``SWIFT_code`` | ``content`` is a dictionary encoded as a string. |
| | | | | |
@ -453,31 +456,56 @@ list of all the fields we can extract from an invoice.
+-------------------------+------------------------------------------------------------------------+ +-------------------------+------------------------------------------------------------------------+
``feature_result`` for the ``invoice_lines`` feature ``invoice_lines`` feature
**************************************************** *************************
It follows a more specific structure. It is basically a list of dictionaries where each dictionary It is returned as a list of dictionaries where each dictionary represents an invoice line.
represents an invoice line. Each value follows a
:ref:`latestextract_api/get_result/feature_result` structure.
.. code-block:: js .. code-block:: js
"invoice_lines": [ "invoice_lines": [
{ {
"description": feature_result, "description": string,
"discount": feature_result, "quantity": float,
"product": feature_result, "subtotal": float,
"quantity": feature_result, "total": float,
"subtotal": feature_result, "taxes": list[float],
"total": feature_result, "total": float,
"taxes": feature_result, "unit_price": float
"total": feature_result,
"unit": feature_result,
"unit_price": feature_result
}, },
... ...
] ]
Bank statements
~~~~~~~~~~~~~~~
The following table gives a list of all the fields that are extracted from bank statements.
+-------------------------+------------------------------------------------------------------------+
| Feature name | Specificities |
+=========================+========================================================================+
| ``balance_start`` | ``content`` is a float |
+-------------------------+------------------------------------------------------------------------+
| ``balance_end`` | ``content`` is a float |
+-------------------------+------------------------------------------------------------------------+
| ``date`` | ``content`` is a string |
+-------------------------+------------------------------------------------------------------------+
``bank_statement_lines`` feature
********************************
It is returned as a list of dictionaries where each dictionary represents a bank statement line.
.. code-block:: js
"bank_statement_lines": [
{
"amount": float,
"description": string,
"date": string,
},
...
]
Expense Expense
~~~~~~~ ~~~~~~~
@ -486,7 +514,7 @@ The expenses are less complex than invoices. The following table gives an exhaus
fields we can extract from an expense report. fields we can extract from an expense report.
+-------------------------+------------------------------------------------------------------------+ +-------------------------+------------------------------------------------------------------------+
| Feature name | Specifities | | Feature name | Specificities |
+=========================+========================================================================+ +=========================+========================================================================+
| ``description`` | ``content`` is a string | | ``description`` | ``content`` is a string |
+-------------------------+------------------------------------------------------------------------+ +-------------------------+------------------------------------------------------------------------+
@ -506,7 +534,7 @@ This third type of document is meant for processing resumes. The following table
list of all the fields we can extract from a resume. list of all the fields we can extract from a resume.
+-------------------------+------------------------------------------------------------------------+ +-------------------------+------------------------------------------------------------------------+
| Feature name | Specifities | | Feature name | Specificities |
+=========================+========================================================================+ +=========================+========================================================================+
| ``name`` | ``content`` is a string | | ``name`` | ``content`` is a string |
+-------------------------+------------------------------------------------------------------------+ +-------------------------+------------------------------------------------------------------------+