Skip to content
ERPForAll DocsDevelopment

    Tax definitions

    The account addon owns tax groups, tax definitions and invoice/refund repartition lines. This foundation configures definitions; the shared calculation kernel, fiscal positions, cash basis and journal-item usage probes are delivered by their respective slices.

    A tax belongs to one company and carries that company’s root identity. Active taxes with a use other than none have a unique source-language name within the root company, use, scope and country. The database index protects concurrent writers; a normal create or write checks candidates in a batch to return a detailed conflict message. Translations do not create independent uniqueness namespaces. Change translated names through normal model writes in the desired language. Low-level native translation-map editing is a framework API, rather than a tax RPC; it relies on the database key instead of the model writer’s detailed duplicate diagnostics.

    Tax amount and repartition percentages use exact decimal values. Send decimal strings through the normal RPC value conversion. Amount uses four decimal places and factor percent uses twelve. A tax’s factor ratio is its percentage divided by 100, with exact decimal arithmetic.

    Creating a tax without distributions generates one base and one tax row for each document kind. Supply both invoice and refund changes in one parent operation: each side needs exactly one base row, at least one tax row, matching ordered types and percentages, and the required positive/negative totals. Direct child operations must leave the owning definitions valid too. A repartition row always has an owning tax, and its company follows that owner.

    The database-wide System Parameter account.tax_repartition_lines_max defaults to 16 lines per tax and document kind, including the base row. Its floor is 2 and hard bound 64. An administrator can change it in Technical > System Parameters. Account 1.10 carries an existing global Taxes setting into that parameter during upgrade.

    Company fiscal country and the price-inclusion default are fields on the company. The address-country fallback follows company.partner_id.country_id, because the current base model stores the address country on its company contact. A tax may override price inclusion.

    No standalone taxes or groups are installed: chart/localization packs supply jurisdiction-specific definitions. Create a matching tax group before a tax when no chart has been loaded. Reference data is described in odoo/addons/account/data/template/account.tax-generic_coa.csv and account.tax.group-generic_coa.csv; these reference records are not copied into the addon.

    The used probe is an overridable model method. A referencing addon must extend it before introducing a relation that makes a tax used. The delete guard calls it and advises archiving a used definition. The foundation has no move or reconciliation references, so real usage detection remains incomplete until the journal-item and reconciliation integrations extend it.

    The audit trail records call identity, actor and targets through the existing core. Durable old/new repartition history belongs to the tax change-history integration and the core value-carrying change record. The current registry cannot track translated fields; translated tax-name capture is deferred explicitly. Do not claim tax change history from the foundation alone.

    Install or upgrade account through the normal module lifecycle and verified addon identity receipts. Schema sync creates the new tables and source-name index; existing companies receive the excluded-price default. This does not load a chart. Configure the company’s fiscal country, create an appropriate tax group, then create taxes. A missing country or group is refused rather than replaced by invented jurisdiction data.

    Existing account/journal records remain in place. This foundation requires no accounting-private history migration. If schema sync finds duplicate active source keys in a later imported database, repair the definitions explicitly before retrying; do not disable the index or silently rename records. A serialization failure during concurrent distribution edits is handled by the existing transaction retry boundary.

    Extend _is_used as a batch method returning one boolean for each input record, in order, and retain the previous implementation. Unlink probes it afresh. Do not trust a cached display flag when enforcing deletion. New reference-bearing addons must add their probes before making a tax used.

    root_company_id, repartition_serial and a line’s company_id are derived. Callers may not supply them. root_company_id is a stored computed field on company_id: a change of the tax’s company, also one made by server code past the tax’s own write, moves the root with it. Such a change keeps the tax’s country and tax group as they are; write them in the same call when they must change too. Supply the owning tax_id on a direct line creation. Parent edits coordinate nested line mutations and validate the completed invoice/refund pair once; direct child edits validate their affected parents too. Every operation retains normal model, field and company admission.

    The plain tax form exposes the two distributions through the existing relation widget. Each grid passes its document side (default_document_type) to new lines, and the line views hide the document side and the owning tax. Complete side-by-side inline editing is outside this foundation. Configure custom splits atomically through a parent write until that editor is delivered.

    The accounting addon extends companies with nullable account_sale_tax_id and account_purchase_tax_id. The company form’s Taxes page edits them independently. These ordinary tax FKs enforce company consistency; the empty choice means no configured default. It does not mean that a document is tax exempt. The dedicated company-accounting form has a later stored view priority, so its explicit action leaves the general company form and its tax extensions available through ordinary company navigation.

    account.account.tax_ids provides account-level choices. Off-balance accounts cannot have default taxes, including when changing type and tax links together. A repartition-line reference prevents deleting its account; archiving remains supported. There is no legacy deprecated field.

    Accounting extends product.template with taxes_id and supplier_taxes_id; variants delegate to the template. For each direction, defaults collect the selected companies’ choices. Only an empty collection falls back to inherited company defaults. Explicit choices, including explicit empty commands and contextual defaults, take precedence. The company-set product’s choices must apply to that company or its ancestors. Shared-product choices may span selected companies and their ancestors; new targets retain caller read admission. Existing unreadable links survive replacement and clearing through the ORM’s relation writer and are not returned by write. After every create, and after every write that supplies a tax field or the company, the stored links of a company-set product are checked again in the database, archived and unreadable taxes included; a tax of another company is refused without naming it.

    The stored readonly effective_account_sale_tax_id and effective_account_purchase_tax_id fields hold the configured company choice, else its parent’s effective choice. Declared dependencies update inheriting descendants after an ancestor default changes. These fields are not Settings inputs; assigning them is refused. Product defaults read only selected company rows and omit unreadable tax targets. No explicit elevation or core API extension is used.

    Upgrading accounting creates the nullable company columns and tax relations without filling existing products or creating jurisdiction taxes. A later default change affects the next proposed product choice; it does not rewrite stored choices. No additional schedule, numeric limit or background job is introduced.

    A product shared between companies receives editable defaults from the companies selected at creation only, with inherited defaults (a later release adds the rest). Defaults of unselected companies are not copied. The per-company resolver, explicit no-tax marker, inherited-choice display and document integration are not available yet. Do not infer tax exemption from an absent product link in another company.