Skip to main content
Odoo Community Association

US Sales Tax Engine

Alpha License: LGPL-3 OCA/l10n-usa Translate me on Weblate Try me on Runboat

Hybrid US Sales Tax engine for Odoo: resolves the combined state + county + city + district rate for a ZIP code, applies it to sale orders and invoices, and keeps a full audit trail of every calculation.

Resolution order: local rate database first, external API providers as fallback (configured independently in their own l10n_us_sales_tax_provider_* modules — this module never imports their code directly). Tracks nexus per state, taxability per product category, and caches external API responses to control call volume.

Table of contents

Configuration

Enabling the engine

Settings → Invoicing → US Sales Tax Engine → Enable US Sales Tax Engine turns the engine on. Until it is ticked, the block shows nothing else.

Engine disabled

Once it is ticked, the block shows Automatic Tax Calculation, Engine Mode, API Failure Policy, Cache TTL (hours) and ZIP Confidence Threshold.

Engine enabled

Automatic tax calculation

Settings → Invoicing → US Sales Tax Engine → Automatic Tax Calculation decides when the engine runs without anyone pressing Calculate US Tax. The option is shown once Enable US Sales Tax Engine is ticked, and it has two modes:

  • Off — only the Calculate US Tax button. Tax is calculated only when someone presses Calculate US Tax on the sale order or the customer invoice.

  • On Validation — on order confirmation and invoice posting. The engine also runs when a sale order is confirmed and when a customer invoice or credit note is posted. This is the default, and it is also the mode of a database where no mode has ever been chosen.

Unticking Enable US Sales Tax Engine stops every calculation, whatever mode is stored: confirming an order or posting an invoice calculates nothing, and Calculate US Tax, which stays on the documents, leaves their taxes as they are.

Automatic Tax Calculation

Scheduled actions

The module ships two scheduled actions, both under Settings → Technical → Automation → Scheduled Actions (developer mode), both running as OdooBot.

US Tax: Purge Expired Cache (daily) — archives the entries in Invoicing → Configuration → US Sales Tax → Audit → Cache whose expiry has passed. An API response is cached per ZIP, state, fiscal category and month for as long as Cache TTL (hours) says, so that repeated calculations on the same address cost no external call. The cron only archives: nothing is deleted, and the archived entries stay readable with the Expired filter, which keeps the record of what rate was applied and when.

US Tax: Reset Monthly API Call Counters (monthly) — sets Calls This Month back to zero on every provider and re-arms the warning that fires at 80% of Monthly Call Limit. It exists because providers bill per calendar month while Odoo counts continuously; a counter that never resets would leave every provider looking exhausted. A provider with a limit of 0 is unlimited and is not affected in practice. Both fields are on each provider, under Invoicing → Configuration → US Sales Tax → Configuration → Providers.

Local Database provider

Loading local rate data

The local provider needs three things before it can resolve a tax rate for a ZIP code: a Jurisdiction (county/city), a ZIP Mapping pointing that ZIP to the jurisdiction, and a Tax Rate on that jurisdiction. None of these ship pre-loaded — only product categories and the provider registry are seeded on install.

US Sales Tax menu

The seeded categories are under Invoicing → Configuration → US Sales Tax → Configuration → Product Tax Categories.

Product Tax Categories

Import Tax Rates wizard

Invoicing → Configuration → US Sales Tax → Rate Database → Import Rates always requires a file upload — there is no “instant, no file” option in the wizard.

  • Florida DOR: upload the official Master Address List CSV from https://pointmatch.floridarevenue.com/General/AddressFiles.aspx (select a county and effective date, then download). This creates the jurisdiction, the rate, and the ZIP mapping for every row — full ZIP-level resolution.

  • Generic CSV (any state): a file whose headers are, in lower case, zip, county, city and the rate columns state_rate, county_rate, city_rate, district_rate and total_rate. When total_rate is empty it is the sum of the other four. Each row creates the jurisdiction, the rate and the ZIP mapping in the same way.

  • Texas Open Data: read with the Generic CSV columns.

Manual setup (quick test, single ZIP)

For testing a single ZIP without downloading a file, create the three records by hand under Invoicing → Configuration → US Sales Tax → Rate Database:

  1. Jurisdictions — name, type (county/city), state.

  2. ZIP Mappings — the ZIP code, pointing to that jurisdiction.

  3. Tax Rates — the actual rate values on that jurisdiction.

Tax Rates

Nexus is independent of rate data

Creating a Nexus record (Invoicing → Configuration → US Sales Tax → Configuration → Nexus) only marks that the company has a legal obligation to collect tax in that state — it does not create or require any jurisdiction, ZIP mapping, or rate. Both are needed independently before a sale order calculates a non-zero local tax.

Nexus

Usage

Calculating US sales tax

With Enable US Sales Tax Engine ticked, Calculate US Tax on the sale order and on the customer invoice or credit note runs the engine on demand. Depending on Automatic Tax Calculation, the engine also runs on its own when a sale order is confirmed and when a customer invoice or credit note is posted. Both settings live under Settings → Invoicing → US Sales Tax Engine and are described in Configuration.

Calculate US Tax on a draft invoice

The engine prices a document only when the address it uses has its country set to the United States and carries a ZIP and a state. A ZIP and a state with no country are not taken for a US address. When the engine runs on a document it had priced and that has since lost such an address, it takes its own US Sales Tax taxes off the lines and leaves any other tax where it is.

Calculation logs

Invoicing → Configuration → US Sales Tax → Audit → Calculation Logs holds the rows the engine writes, with the document, the address, the source of the rate, the rate breakdown, the taxable and tax amounts and a Status. Which runs leave a row:

  • every calculation on a US address with a ZIP and a state, whether it finds a rate or an exemption, or no provider answers;

  • a run on a document whose address is not a US one, or has no ZIP or state, only when it takes the engine’s own taxes off the lines or fails to. Its source reads Skipped — Not a US Address or Skipped — No ZIP or State. A run there that finds no tax of the engine on the lines leaves no row;

  • no run at all while Enable US Sales Tax Engine is unticked.

The Status is:

  • Success when the tax was found and written on the lines;

  • Error when no provider answered, or the tax could not be written on the lines or taken off them;

  • Skipped when the engine took its own taxes off a document whose address is not a US one, or has no ZIP or state.

Calculation logs

Calculation log

Where the Block failure policy applies

What follows applies with Automatic Tax Calculation set to On Validation, the mode that runs the engine on order confirmation and invoice posting.

With API Failure Policy set to Block — prevent document confirmation, a calculation where every provider failed raises an error. Confirming the sale order or posting the invoice is refused with US sales tax could not be calculated for …, and the document stays as it was.

Under the other policies confirming or posting goes through. When no provider answered, a note in the document’s chatter says that the US sales tax could not be calculated and asks to check the tax before sending the document.

A tax that cannot be written on the lines never stops the confirmation or the posting, whatever the policy. The note in the chatter then says that the tax could not be written on the lines, that they kept the tax they had, and asks to calculate it again before sending the document.

Nexus in a company tree

A nexus also covers the branches of its company, at any depth: a document of a branch or sub-branch is taxed in every state where that branch or one of its parent companies has an active nexus. A nexus on a branch covers the branch and its own branches, never its parent company or its sibling branches.

The Nexus menu lists, for each company a user can access, its own nexus and the ones of its parent companies, so a user who only accesses a branch sees every nexus that taxes the branch documents. The nexus of sibling branches stays hidden. A parent company nexus is read-only from the branch: only a user with access to the company that owns it can edit or delete it.

Zero-tax lines always carry an explicit tax, never an empty tax field

When a line ends up with 0% tax, the engine always assigns a real account.tax record rather than leaving the line untaxed:

  • Exempt product category, no nexus in that state, or a customer marked US Tax Exempt — assigned the shared US Sales Tax - Exempt (0%) tax (one tax for all three reasons, across all states).

  • A state with a genuine 0% combined rate (e.g. Oregon, Montana — states with no sales tax at all) — assigned US Sales Tax {state} 0%, the same per-state-and-rate tax used for any other rate.

A line left at 0% because no provider answered carries US Sales Tax {state} 0% as well. The calculation log row recorded as an error, and on confirmation or posting the chatter note, are what tell it apart from a genuine 0% rate.

This is deliberate: an empty tax_id is indistinguishable from “tax was never calculated” on an invoice or in a tax report filtered/grouped by account.tax/account.tax.group. An explicit 0% tax record shows that the line was evaluated and a deliberate “no tax due” determination was made — the kind of audit trail a sales-tax-exempt line should leave behind.

The specific reason for a 0% line (which product category, which state, nexus or no nexus) is not encoded in the tax’s name — that level of detail already lives on us.tax.calculation.log, one record per calculation. The tax itself only needs to answer “was this evaluated, and is it taxable” at a glance.

Reports on untaxed lines. A report that looks for lines with no tax_id/tax_ids at all to find missing tax does not match the lines the engine evaluated, because those carry the explicit 0% tax.

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.

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

Credits

Authors

  • Binhex

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

crrodrigueztrujillo

This module is part of the OCA/l10n-usa project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Metadata

Release files for odoo-addon-l10n-us-sales-tax-engine 18.0.1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-l10n-us-sales-tax-engine 18.0.1.4.0
File Interpreter ABI Platform Actions
odoo_addon_l10n_us_sales_tax_engine-18.0.1.4.0-py3-none-any.whl Python 3 none any Details for odoo_addon_l10n_us_sales_tax_engine-18.0.1.4.0-py3-none-any.whl

Release files / odoo_addon_l10n_us_sales_tax_engine-18.0.1.4.0-py3-none-any.whl

Download URL odoo_addon_l10n_us_sales_tax_engine-18.0.1.4.0-py3-none-any.whl
Size 2.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
77eff178bb2480e5b2a4d8b234b7d32ab67292252be80fb35fccf4d2caf3c474
BLAKE2b-256 checksum
How to use checksums
2193fc697e32a464e9779733381abcfb5a453c915a1ab3c3c11ba7816bc4cc99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for odoo-addon-l10n-us-sales-tax-engine 18.0.1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page