diff --git a/account_invoice_import/README.rst b/account_invoice_import/README.rst index 0718607fa67..4d10bd8c9d7 100644 --- a/account_invoice_import/README.rst +++ b/account_invoice_import/README.rst @@ -17,13 +17,13 @@ Account Invoice Import :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/14.0/account_invoice_import + :target: https://github.com/OCA/edi/tree/16.0/account_invoice_import :alt: OCA/edi .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-account_invoice_import + :target: https://translation.odoo-community.org/projects/edi-16-0/edi-16-0-account_invoice_import :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=14.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/edi&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -99,7 +99,7 @@ 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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -142,6 +142,6 @@ Current `maintainer `__: |maintainer-alexis-via| -This module is part of the `OCA/edi `_ project on GitHub. +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. diff --git a/account_invoice_import/__manifest__.py b/account_invoice_import/__manifest__.py index 9cd6af1ecfc..7fb02322663 100644 --- a/account_invoice_import/__manifest__.py +++ b/account_invoice_import/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Account Invoice Import", - "version": "14.0.3.4.0", + "version": "16.0.1.0.0", "category": "Accounting & Finance", "license": "AGPL-3", "summary": "Import supplier invoices/refunds as PDF or XML files", diff --git a/account_invoice_import/static/description/index.html b/account_invoice_import/static/description/index.html index e8e2e62e3ea..7fac16a6f73 100644 --- a/account_invoice_import/static/description/index.html +++ b/account_invoice_import/static/description/index.html @@ -369,7 +369,7 @@

Account Invoice Import

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:26f0853d4122605d020e48687fa420f66fdad1a6c7e41efe74059e0a845f5348 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module has been started by lazy accounting users who hate enter they vendor bills manually in Odoo. Almost all companies have several vendor bills to enter regularly in the system from the same vendors: phone bill, electricity bill, Internet access, train tickets, etc. Most of these invoices are available as PDF. If we are able to automatically extract from the PDF the required information to enter the invoice as vendor bill in Odoo, then this module will create it automatically. To know the full story behind the development of this module, read this blog post.

In order to reliably extract the required information from the invoice, two international standards exists to describe an Invoice in XML:

    @@ -441,7 +441,7 @@

    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 to smash it by providing a detailed and welcomed -feedback.

    +feedback.

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

    @@ -474,7 +474,7 @@

    Maintainers

    promote its widespread use.

    Current maintainer:

    alexis-via

    -

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

    +

    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.

    diff --git a/account_invoice_import/tests/test_invoice_import.py b/account_invoice_import/tests/test_invoice_import.py index 56087a79810..515379f92bc 100644 --- a/account_invoice_import/tests/test_invoice_import.py +++ b/account_invoice_import/tests/test_invoice_import.py @@ -8,42 +8,46 @@ from unittest import mock from odoo import fields -from odoo.tests.common import SavepointCase +from odoo.tests.common import TransactionCase from odoo.tools import file_open, float_is_zero logger = logging.getLogger(__name__) -class TestInvoiceImport(SavepointCase): +class TestInvoiceImport(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() cls.company = cls.env.ref("base.main_company") cls.company.invoice_import_email = "alexis.delattre@testme.com" cls.expense_account = cls.env["account.account"].create( - { - "code": "612AII", - "name": "expense account invoice import", - "user_type_id": cls.env.ref("account.data_account_type_expenses").id, - "company_id": cls.company.id, - } + [ + { + "code": "612AII", + "name": "expense account invoice import", + "account_type": "expense", + "company_id": cls.company.id, + } + ] ) cls.income_account = cls.env["account.account"].create( - { - "code": "707AII", - "name": "revenue account invoice import", - "user_type_id": cls.env.ref("account.data_account_type_revenue").id, - "company_id": cls.company.id, - } + [ + { + "code": "707AII", + "name": "revenue account invoice import", + "account_type": "income", + "company_id": cls.company.id, + } + ] ) cls.adjustment_account = cls.env["account.account"].create( - { - "code": "Adjustment", - "name": "adjustment from invoice import", - "user_type_id": cls.env.ref( - "account.data_account_type_current_assets" - ).id, - } + [ + { + "code": "Adjustment", + "name": "adjustment from invoice import", + "account_type": "asset_current", + } + ] ) purchase_tax_vals = { "name": "Test 1% VAT Purchase", @@ -58,7 +62,7 @@ def setUpClass(cls): # "account_id": cls.expense_account.id, # "refund_account_id": cls.expense_account.id, } - cls.purchase_tax = cls.env["account.tax"].create(purchase_tax_vals) + cls.purchase_tax = cls.env["account.tax"].create([purchase_tax_vals]) sale_tax_vals = purchase_tax_vals.copy() sale_tax_vals.update( { @@ -67,16 +71,18 @@ def setUpClass(cls): "type_tax_use": "sale", } ) - cls.sale_tax = cls.env["account.tax"].create(sale_tax_vals) + cls.sale_tax = cls.env["account.tax"].create([sale_tax_vals]) cls.product = cls.env["product.product"].create( - { - "name": "Expense product", - "default_code": "AII-TEST-PRODUCT", - "taxes_id": [(6, 0, [cls.sale_tax.id])], - "supplier_taxes_id": [(6, 0, [cls.purchase_tax.id])], - "property_account_income_id": cls.income_account.id, - "property_account_expense_id": cls.expense_account.id, - } + [ + { + "name": "Expense product", + "default_code": "AII-TEST-PRODUCT", + "taxes_id": [(6, 0, [cls.sale_tax.id])], + "supplier_taxes_id": [(6, 0, [cls.purchase_tax.id])], + "property_account_income_id": cls.income_account.id, + "property_account_expense_id": cls.expense_account.id, + } + ] ) cls.all_import_config = [ { @@ -99,51 +105,59 @@ def setUpClass(cls): # Deco Addict cls.env.ref("base.res_partner_2").customer_rank = 1 cls.pur_journal1 = cls.env["account.journal"].create( - { - "type": "purchase", - "code": "XXXP1", - "name": "Test Purchase Journal 1", - "sequence": 10, - "company_id": cls.company.id, - } + [ + { + "type": "purchase", + "code": "XXXP1", + "name": "Test Purchase Journal 1", + "sequence": 10, + "company_id": cls.company.id, + } + ] ) cls.pur_journal2 = cls.env["account.journal"].create( - { - "type": "purchase", - "code": "XXXP2", - "name": "Test Purchase Journal 2", - "sequence": 100, - "company_id": cls.company.id, - } + [ + { + "type": "purchase", + "code": "XXXP2", + "name": "Test Purchase Journal 2", + "sequence": 100, + "company_id": cls.company.id, + } + ] ) cls.partner_with_email = cls.env["res.partner"].create( - { - "is_company": True, - "name": "AgroMilk", - "email": "invoicing@agromilk.com", - "country_id": cls.env.ref("base.fr").id, - } + [ + { + "is_company": True, + "name": "AgroMilk", + "email": "invoicing@agromilk.com", + "country_id": cls.env.ref("base.fr").id, + } + ] ) cls.partner_with_email_with_inv_config = cls.env["res.partner"].create( - { - "is_company": True, - "name": "Anevia", - "email": "invoicing@anevia.com", - "country_id": cls.env.ref("base.fr").id, - "invoice_import_ids": [ - ( - 0, - 0, - { - "name": "Import config for Anevia", - "company_id": cls.company.id, - "invoice_line_method": "1line_static_product", - "static_product_id": cls.product.id, - "label": "Flamingo 220S", - }, - ) - ], - } + [ + { + "is_company": True, + "name": "Anevia", + "email": "invoicing@anevia.com", + "country_id": cls.env.ref("base.fr").id, + "invoice_import_ids": [ + ( + 0, + 0, + { + "name": "Import config for Anevia", + "company_id": cls.company.id, + "invoice_line_method": "1line_static_product", + "static_product_id": cls.product.id, + "label": "Flamingo 220S", + }, + ) + ], + } + ] ) company = cls.env.ref("base.main_company") company.update( @@ -366,10 +380,12 @@ def test_email_gateway(self): def test_email_gateway_multi_comp_1_matching(self): comp = self.env["res.company"].create( - { - "name": "Let it fail INC", - "invoice_import_email": "project-discussion@example.com", - } + [ + { + "name": "Let it fail INC", + "invoice_import_email": "project-discussion@example.com", + } + ] ) logger_name = "odoo.addons.account_invoice_import.wizard.account_invoice_import" @@ -408,7 +424,7 @@ def test_email_gateway_multi_comp_1_matching(self): self.assertIn(msg, "\n".join(watcher.output)) def test_email_gateway_multi_comp_none_matching(self): - self.env["res.company"].create({"name": "Let it fail INC"}) + self.env["res.company"].create([{"name": "Let it fail INC"}]) logger_name = "odoo.addons.account_invoice_import.wizard.account_invoice_import" with self.assertLogs(logger_name, "ERROR") as watcher: self.env["mail.thread"].with_context( diff --git a/account_invoice_import/views/account_invoice_import_config.xml b/account_invoice_import/views/account_invoice_import_config.xml index d44b412e3ec..7415608b149 100644 --- a/account_invoice_import/views/account_invoice_import_config.xml +++ b/account_invoice_import/views/account_invoice_import_config.xml @@ -21,6 +21,7 @@ + diff --git a/account_invoice_import/views/account_journal_dashboard.xml b/account_invoice_import/views/account_journal_dashboard.xml index 9a695d8fd0a..92263ddef3a 100644 --- a/account_invoice_import/views/account_journal_dashboard.xml +++ b/account_invoice_import/views/account_journal_dashboard.xml @@ -9,15 +9,28 @@ account.journal - + 1 + + + + diff --git a/account_invoice_import/views/res_partner.xml b/account_invoice_import/views/res_partner.xml index 8b103ab394a..be4110594fa 100644 --- a/account_invoice_import/views/res_partner.xml +++ b/account_invoice_import/views/res_partner.xml @@ -8,16 +8,16 @@ res.partner -