From fafdcf6f0dedfce207beba009b63e0dca0453456 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 25 Jul 2024 14:38:19 +0200 Subject: [PATCH] [IMP] account_invoice_import: add support for discount Add support for discount on lines in the multi-line create scenario --- account_invoice_import_invoice2data/README.rst | 2 +- account_invoice_import_invoice2data/__manifest__.py | 2 +- .../static/description/index.html | 13 ++++++++----- .../tests/test_invoice_import.py | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/account_invoice_import_invoice2data/README.rst b/account_invoice_import_invoice2data/README.rst index 0132a1d1a2..3328fa3729 100644 --- a/account_invoice_import_invoice2data/README.rst +++ b/account_invoice_import_invoice2data/README.rst @@ -7,7 +7,7 @@ Account Invoice Import Invoice2data !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:30a57a00c9b4505590e39f8952a5b45a0dedbb2a620382eb13ba6e3c53f89400 + !! source digest: sha256:c7d1d2a38227a9bf81bc6132091b5285a4afe0b1280bea7541ebab212f57f16a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/account_invoice_import_invoice2data/__manifest__.py b/account_invoice_import_invoice2data/__manifest__.py index 9ef53b17b9..45c204ffd8 100644 --- a/account_invoice_import_invoice2data/__manifest__.py +++ b/account_invoice_import_invoice2data/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Account Invoice Import Invoice2data", - "version": "14.0.2.3.0", + "version": "14.0.2.4.0", "category": "Accounting/Accounting", "license": "AGPL-3", "summary": "Import supplier invoices using the invoice2data lib", diff --git a/account_invoice_import_invoice2data/static/description/index.html b/account_invoice_import_invoice2data/static/description/index.html index 271c5dc4f8..a3f302efe2 100644 --- a/account_invoice_import_invoice2data/static/description/index.html +++ b/account_invoice_import_invoice2data/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -366,7 +367,7 @@

Account Invoice Import Invoice2data

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:30a57a00c9b4505590e39f8952a5b45a0dedbb2a620382eb13ba6e3c53f89400 +!! source digest: sha256:c7d1d2a38227a9bf81bc6132091b5285a4afe0b1280bea7541ebab212f57f16a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

This module is an extension of the module account_invoice_import: it adds support for regular PDF invoices i.e. PDF invoice that don’t have an embedded XML file. It uses the invoice2data library which takes care of extracting the text of the PDF invoice, find an existing invoice template and execute the invoice template to extract the useful information from the invoice.

@@ -589,7 +590,9 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +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.

diff --git a/account_invoice_import_invoice2data/tests/test_invoice_import.py b/account_invoice_import_invoice2data/tests/test_invoice_import.py index 90220ca42c..09ce1d90f5 100644 --- a/account_invoice_import_invoice2data/tests/test_invoice_import.py +++ b/account_invoice_import_invoice2data/tests/test_invoice_import.py @@ -174,7 +174,7 @@ def test_import_azure_interior_invoice(self): # self.assertEqual(inv.journal_id.payment_reference, "202309097001") # self.assertEqual(inv.journal_id.incoterm_id, self.env.ref("account.incoterm_DPU") - self.assertEqual(len(inv.invoice_line_ids), 8) + self.assertEqual(len(inv.invoice_line_ids), 7) iline = inv.invoice_line_ids[0] self.assertEqual(iline.name, "--- Non Food ---") self.assertEqual(iline.display_type, "line_section") @@ -205,9 +205,9 @@ def test_import_azure_interior_invoice(self): iline.product_id, self.env.ref("account_invoice_import_invoice2data.olive_oil"), ) - # todo test discount, not yet implemented in account_invoice_import self.assertEqual(float_compare(iline.quantity, 1.0, precision_digits=0), 0) self.assertEqual(float_compare(iline.price_unit, 1.00, precision_digits=2), 0) + self.assertEqual(float_compare(iline.discount, 10, precision_digits=2), 0) iline = inv.invoice_line_ids[5] self.assertEqual( iline.name, "Our Olive Oil is delivered in a re-usable glass container"