[16.0][ADD] account_invoice_import_invoice2data_db_templates - #1365
Draft
bosd wants to merge 104 commits into
Draft
[16.0][ADD] account_invoice_import_invoice2data_db_templates#1365bosd wants to merge 104 commits into
bosd wants to merge 104 commits into
Conversation
…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.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: edi-14.0/edi-14.0-account_invoice_import_invoice2data Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-account_invoice_import_invoice2data/
Currently translated at 100.0% (16 of 16 strings) Translation: edi-14.0/edi-14.0-account_invoice_import_invoice2data Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-account_invoice_import_invoice2data/nl/
Currently translated at 100.0% (16 of 16 strings) Translation: edi-14.0/edi-14.0-account_invoice_import_invoice2data Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-account_invoice_import_invoice2data/es/
… PDF invoices Restore implementation in OCA#630: - when importing an invoice for an unknown partner, it creates an empty invoice with PDF a s attachment
DISABLED_MAIL_CONTEXT is not available yet in v14 and v15.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: edi-14.0/edi-14.0-account_invoice_import_invoice2data Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-account_invoice_import_invoice2data/
Add support for discount on lines in the multi-line create scenario
Translated using Weblate (Italian) Currently translated at 6.6% (1 of 15 strings) Translation: edi-14.0/edi-14.0-account_invoice_import_invoice2data Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-account_invoice_import_invoice2data/it/ Translated using Weblate (Italian) Currently translated at 13.3% (2 of 15 strings) Translation: edi-14.0/edi-14.0-account_invoice_import_invoice2data Translate-URL: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-account_invoice_import_invoice2data/it/
bosd
force-pushed
the
16.0-store_invoice2data_templates
branch
from
July 18, 2026 17:36
007b588 to
446ff7c
Compare
DB-stored invoice2data templates + GUI builder as a new addon that depends on account_invoice_import_invoice2data (this PR is stacked on top of OCA#1220). - `invoice2data.template` model with two authoring modes: guided (name + keywords + `field_ids` o2m composing the JSON at read time) and power- user (paste a full invoice2data JSON template into a dedicated tab). - Per-field `replace` pair (issue invoice2data#497) and `extract_number` flag (issue invoice2data#652) exposed as first-class columns. - Form actions: Preview text, Test (full extract_data() vs chatter PDF), and Suggest fields (wires the lib's suggested_template + label detection to pre-fill the field grid). - Wizard extension reimplements invoice2data_parse_invoice: builds the templates list via a `_invoice2data_collect_templates` hook that concatenates disk + DB. Uses `with NamedTemporaryFile(...)` + flush() (matches the review on OCA#1220). - Security: dedicated 'Manage invoice2data templates' group. - Tests: JSON round-trip, structured composition, replace pair, extract_number opt-in semantics, type/active filtering, wizard merge. Selection lists are driven from invoice2data.extract.schema so adding a new canonical field upstream automatically becomes selectable here.
added 2 commits
July 19, 2026 21:48
Two red-CI fixes: - `_field_selection` was defined as a zero-arg function but Odoo passes `self` to selection callables; test errors were: `TypeError: _field_selection() takes 0 positional arguments but 1 was given` - black + isort reformats to satisfy OCA/edi's pre-commit config.
Pre-commit's 'unchecked-in-files' guard was failing because the OCA
setup/<addon>/{setup.py, odoo/addons/<addon>} scaffolding wasn't
committed alongside the module. Add it (matches what
setuptools-odoo-make-default generates).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #1220 (the 16.0 migration of
account_invoice_import_invoice2data). Until that lands the diff includes its commits; once it merges this rebases cleanly ontoOCA/edi 16.0.What this adds
A new addon,
account_invoice_import_invoice2data_db_templates, that stores invoice2data templates in the Odoo database and merges them into the import wizard alongside the existing disk-loaded ones. Implements the GUI template builder the parent module's 2017 TODO list asked for.Authoring modes
field_idso2m; JSON is composed at save time.The canonical field-name selection list is driven from
invoice2data.extract.schema— adding a new canonical field upstream automatically becomes selectable here, no parallel list to maintain.Buttons on the form
to_texton the latest chatter attachment.extract_data()against the attached PDF using this template + the disk-loaded ones; surfaces the parsed dict and required-fields warnings.invoice2data.extract.template_builder.suggested_template+ the label-detection helpers to pre-fill the field grid from the latest attached PDF (the "guessing framework" the 2017 TODO list asked for).Wizard merge
Extends
account.invoice.importto reimplementinvoice2data_parse_invoicecleanly:with NamedTemporaryFile(...) as fileobj:+fileobj.flush()(matches my review on [MIG] account_invoice_import_invoice2data: Migration to 16.0 #1220)._invoice2data_collect_templateshook (disk + DB; downstream modules can override).First-class support for the 1.0 lib options
Per-field
replace(issue invoice2data#497) andextract_numberflag (issue invoice2data#652) are exposed as columns on the o2m, not buried in JSON.Security
Manage invoice2data templatesgroup on top ofaccount.group_account_invoice.ir.model.access.csvfor both the parent model and the o2m.Tests
Cover JSON round-trip, structured composition, the
replacepair,extract_numberopt-in semantics, type/active filtering, and the wizard's merged template list.External dependency
invoice2data >= 1.0(now on PyPI — published today). The 1.0 cut includesordered_load,suggested_template, the per-fieldreplace, and theextract_numberfield option this module surfaces.Roadmap (in
readme/ROADMAP.rst)area:-style templates (ties into thecamelot/Excalibur path).--new-template --ai) wired as an action.Reviewers
cc @alexis-via @MarwanBHL — happy to rebase / split / squash per your preferences.