Skip to content

14 mig account invoice import invoice2data#14

Open
rconjour wants to merge 50 commits into
14.0from
14-mig-account_invoice_import_invoice2data
Open

14 mig account invoice import invoice2data#14
rconjour wants to merge 50 commits into
14.0from
14-mig-account_invoice_import_invoice2data

Conversation

@rconjour
Copy link
Copy Markdown

No description provided.

@rconjour rconjour force-pushed the 14-mig-account_invoice_import_invoice2data branch from da49509 to 3d140f9 Compare June 14, 2021 11:09
alexis-via and others added 29 commits June 14, 2021 13:26
…edicated module account_invoice_import_invoice2data

Update README.rst and headers to latest OCA conventions.
Better key names in the parsed_inv dict
parsed_inv doesn't need to be JSON serializable anymore (small drawback: the invoice is parsed a second time on the second step... but the second step is rarely used)
Move code from account_invoice_import_invoice2data to account_invoice_import
Update REAME and some interface strings about UBL being an ISO standard
Small code changes
…voice dict, cleaner organisation)

Code refactoring: move code in base_business_document_import, factorise code for tax matching (it was duplicated in UBL and ZUGFeRD)
Now support PDF with embedded UBL XML file
Enable unittests on account_invoice_import_ubl
More absolute xpath in account_invoice_import_ubl instead of relative xpath

WARNING: these are big changes, I may have broken a few details
…te dir and the built-in templates

Also allow to use only a local template dir
README updated to explain how to configure all this
Special thanks to Sébastien Beau for his help to achieve this
Add support for partner bank matching on invoice update (before, it was only supported on invoice creation)
[FIX] LINT

Use try/except when importing external libs
Remove self.ensure_one() that has nothing to do in an api.model method
…a recent version of pdftotext on travis's ubuntu 12.04 images
Rename __openerp__.py to __manifest__.py and set installable to False
Also port all the modules that generate the XML documents: account_invoice_ubl, account_invoice_zugferd, purchase_order_ubl and sale_order_ubl
… module

Fix spelling mistake and other remarks on README by Tarteo
* Update to work with latest version of invoice2data

* Add requirements.txt file
Update the account_invoice_download_weboob following the changes in account_invoice_download
Add README.rst for the 2 modules
Update text displayed in the invoice import wizard and make list of
supported formats modular (like in bank statement import)
Updated by Actualizar ficheiros PO com o novo POT (msgmerge) hook in Weblate.
alvarorib and others added 19 commits June 14, 2021 13:26
Currently translated at 85.7% (6 of 7 strings)

Translation: edi-10.0/edi-10.0-account_invoice_import_invoice2data
Translate-URL: https://translation.odoo-community.org/projects/edi-10-0/edi-10-0-account_invoice_import_invoice2data/pt/
Currently translated at 85.7% (6 of 7 strings)

Translation: edi-12.0/edi-12.0-account_invoice_import_invoice2data
Translate-URL: https://translation.odoo-community.org/projects/edi-12-0/edi-12-0-account_invoice_import_invoice2data/de/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: edi-12.0/edi-12.0-account_invoice_import_invoice2data
Translate-URL: https://translation.odoo-community.org/projects/edi-12-0/edi-12-0-account_invoice_import_invoice2data/
Currently translated at 100.0% (9 of 9 strings)

Translation: edi-12.0/edi-12.0-account_invoice_import_invoice2data
Translate-URL: https://translation.odoo-community.org/projects/edi-12-0/edi-12-0-account_invoice_import_invoice2data/de/
Currently translated at 100.0% (9 of 9 strings)

Translation: edi-12.0/edi-12.0-account_invoice_import_invoice2data
Translate-URL: https://translation.odoo-community.org/projects/edi-12-0/edi-12-0-account_invoice_import_invoice2data/nl/
* [FEATURE] Invoice2data product line mapping

* Change mapping fields

* Move to account_invoice_import

* Merge custom nline_match_product with nline_auto_product

* Rename product_mapping to product_mapping_ids
* [FIX] Remove thousand separtor on parsing invoices

* Change typo
@rconjour rconjour force-pushed the 14-mig-account_invoice_import_invoice2data branch from 3d140f9 to bb8841f Compare June 14, 2021 11:26
* [FIX] Add ACL for invoice2data users

* Add CRU on account_invoice_import_config

* Return false after iterating through array instead of false negative on firs failure

* Add user and editor access rights

* Solve typo
@rconjour rconjour force-pushed the 14-mig-account_invoice_import_invoice2data branch from bb8841f to 017d2ab Compare June 14, 2021 11:30
@rconjour rconjour force-pushed the 14-mig-account_invoice_import_invoice2data branch from 017d2ab to ab50072 Compare June 14, 2021 11:32
@StefanRijnhart
Copy link
Copy Markdown

Thank you for your hard work! Unfortunately, this code is never going to be tested or run on any scale in our project. I don't feel comfortable proposing such a large change to an OCA module that has this lack of testing (we have underminded the stability of the queue_job module twice already this way). So I will abstain from reviewing this and I don't think we should propose this into the OCA.

@rconjour
Copy link
Copy Markdown
Author

Created the OCA PR as discussed: OCA#399

Copy link
Copy Markdown

@bosd bosd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review no functional test yet..
From what I remember, func test/code change is needed to be able to parse multiline products trough invoice2data module.
Previously it was not possible to have multi lines from the invoice2data module. But now it has been further developed and it supports multi line.

Odoo can be changed to accept multilines.
Some changes to the user messages..

[        help="The multi-line methods will not work for PDF invoices "
        "that don't have an embedded XML file which has structured information "
        "on each line.",](https://github.com/EssentNovaTeam/edi/blob
```/ab5007239a5ce6663a5fac2c70372507b7557e87/account_invoice_import/models/account_invoice_import_config.py#L34-L36)

The error message needs updating too:
https://github.com/EssentNovaTeam/edi/blob/ab5007239a5ce6663a5fac2c70372507b7557e87/account_invoice_import/wizard/account_invoice_import.py#L290-L295

change to something geneeric like
        raise UserError(
            _(
                "You have selected a Multi Line method for this import "
                "but there could no multi lines be extract/read from the supplied file."
            )

maybe some code need adaptation as well.

# @author Robin Conjour <r.conjour@essent.be>
# @author Pieter Paulussen <pieter.paulussen@dynapps.be>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import fields, models
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to from odoo

from tempfile import mkstemp

import pkg_resources
from openerp import _, api, fields, models
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to from odoo

@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<openerp>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to odoo

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also the closing tag on l15
to

import base64

from openerp.tests.common import SavepointCase
from openerp.tools import config, file_open, float_compare
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from odoo.tests.common import SavepointCase # or TransactionCase???
from odoo.tools import config, file_open, float_compare

* 'amount_untaxed' or 'amount_tax' (one or the other, no need for both)
* 'date': the date of the invoice
* 'invoice_number'
* 'date_due', if this information is available in the text of the PDF file.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please include secntion about the product mapping feature. Which fields are accepted.

[
("state", "=", "draft"),
("type", "=", "in_invoice"),
("supplier_invoice_number", "=", "562044387"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref

f.close()
wiz.import_invoice()
# Check result of invoice creation
invoices = self.env["account.invoice"].search(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

account.move

self.assertEquals(len(invoices), 1)
inv = invoices[0]
self.assertEquals(inv.type, "in_invoice")
self.assertEquals(inv.date_due, "2015-07-02")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invoice_date_due

inv = invoices[0]
self.assertEquals(inv.type, "in_invoice")
self.assertEquals(inv.date_due, "2015-07-02")
self.assertEquals(inv.date_invoice, "2015-07-05")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invoice_date

inv.partner_id, self.env.ref("account_invoice_import_invoice2data.free")
)
self.assertEquals(inv.journal_id.type, "purchase")
self.assertEquals(float_compare(inv.check_total, 29.99, precision_digits=2), 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

field check_total no longer available since v9, change to ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.