base_business_document_import
Provides reusable utilities to import external business documents by matching referenced entities and posting the results onto Odoo records.
Key Features
- business.document.import: Offers a shared abstract model with helper APIs for document import workflows, raising localized user errors when extracted data cannot be reconciled.
- res.partner: Matches suppliers or customers using direct ids, XMLIDs, references, VAT numbers, contact details, and website or email domains while logging warnings for ambiguous data.
- delivery: Determines shipping partners via address components, street numbers, and fallback heuristics, optionally tolerating partial data before failing with a detailed error.
- res.partner.bank: Validates IBANs, optionally auto-creates partner bank accounts with inferred banks from BIC codes, and logs why an account could not be linked.
- product.product: Identifies products by id, barcode, packaging barcode, internal reference, or supplierinfo codes so imported lines can target concrete variants.
- res.currency: Resolves currencies via ISO code, symbol, combined ISO or symbol hints, or country code, falling back to the company currency with chatter notices when nothing matches.
- uom.uom: Looks up units of measure by UNECE code or name, maps NIU to C62, and falls back to the product default or Unit(s) while warning users when conversion fails.
- account.tax: Filters taxes by company, usage, price-included behavior, UNECE metadata, and amount comparison to ensure imported amounts use the right fiscal definitions.
- documents: Compares imported document lines against existing ones to compute additions, removals, and field updates while enforcing unique products and consistent units or precision.
- account.account: Matches accounts by code using cached lookup tables, handling extra trailing zeros and flagging approximate matches before raising blocking errors.
- account.analytic.account: Resolves analytic accounts by code via a precomputed cache to speed up imports and ensures missing codes raise actionable errors.
- account.journal: Finds journals by code using cached lookups restricted to the company and errors if the referenced journal cannot be found.
- account.incoterms: Matches incoterms by direct reference, code, or name and raises a blocking error when an imported code is absent.
- res.company: Verifies that the document's company VAT matches the importing company and warns when the local company lacks a VAT number.
- mail.thread: After creating or updating a record, attaches imported files and posts parser notes or chatter messages onto the document for traceability.