US Sales Tax Engine - Origin Sourcing

This module extends the US Sales Tax Engine
(l10n_us_sales_tax_engine) so that sales can be rated with the
address of the company or branch that sells instead of the customer’s
address.
Each company chooses whether new sales orders and customer invoices are
rated, by default, with the customer’s delivery address (destination) or
with the company address (origin). Each draft document keeps its own
Tax Based on Company Address check, so a company can mix in-store
pickups and shipped orders. This covers intrastate sales in origin-based
states and in-store sales in any state.
A company that keeps destination sourcing can still rate with its own
address the documents of customers that have no address, which the
engine alone leaves without tax.
Every calculation log records whether the customer’s or the company’s
address was rated.
Important
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
More details on development status
Table of contents
The US Sales Tax Engine (l10n_us_sales_tax_engine) always rates the
tax with an address of the customer. That is right for a company that
ships to its customers, but not for every sale:
- In origin-based states, a sale made inside the state is taxed at the
rate of the seller’s location, not the customer’s.
- In any state, a sale picked up at the store is taxed where the store
is, even if the customer lives in another state.
Both cases need the address of the selling company instead of the
customer’s.
This module keeps the engine’s calculation and only changes which
address it rates. It does not hold a list of origin-based states: each
company chooses its default sourcing and each document can override it.
With origin sourcing, a document starts rated with the company address
only when the delivery address is in the company’s state or has none; a
shipment to another state starts with the customer address, and an
in-store pickup by an out-of-state customer is checked by hand. The
origin address is the company address, not the one of a warehouse.
It works for a single company and for each branch of a company tree,
since every branch has its own address and its own sourcing setting. A
company that keeps destination sourcing is rated exactly as with the
engine alone.
To configure this module, you need to:
- Select, in the company switcher, the company or branch to configure:
the setting is stored per company.
- Go to Settings > Invoicing > US Sales Tax Engine. The Tax
Sourcing setting is only shown when Enable US Sales Tax Engine is
checked.
- Choose the Tax Sourcing of the company:
- Destination (customer address), the default: new documents are
rated with the customer’s delivery address, as with the engine
alone.
- Origin (company address): new sales orders and customer invoices
are rated with the company address when the customer is in the
company’s state. The company needs a 5-digit ZIP, a state and
United States as country; otherwise the setting cannot be saved,
and that address cannot be left incomplete afterwards, neither on
the company nor on its contact. The whole rate comes from the
company address: see the roadmap for states with mixed sourcing,
such as California.
- With Destination, optionally check Customers Without Address: new
sales orders and customer invoices whose customer has no ZIP are
rated with the company address, instead of not being rated at all. It
needs the same complete company address as Origin.
- Save.

Changing the setting only affects documents created afterwards. Existing
documents keep the check they already have; the ones that exist when the
module is installed start with the check off, so their rating does not
change.
With origin sourcing, the nexus that matters is the one in the state of
the company address, since that is the address being rated.
To use this module, you need to:
- Create a sales order or a customer invoice. The Tax Based on Company
Address check comes:
- checked when the company uses Origin sourcing and the customer’s
delivery address is in the company’s state, or has no state and no
country other than the United States;
- checked too when the company uses Destination sourcing with
Customers Without Address, and the delivery address has no ZIP
and nothing locates the customer elsewhere: a state, a country or a
foreign postal code on the customer, on its company or on the
delivery or invoice address of the document is enough to leave it
unchecked;
- unchecked when the delivery address is in another state or another
country, and otherwise whenever the company uses Destination
sourcing.
- Leave the check on to rate the tax with the address of the document’s
company or branch. Check it by hand for an in-store pickup by an
out-of-state customer. Uncheck it to rate with the customer’s
address: on the sales order, Tax Based on Shipping Address shows
again and chooses between the customer’s delivery and invoice
addresses; customer invoices always use the delivery address.
- Click Calculate US Tax, or confirm the order. With the check on,
the rate is the one of the company ZIP and the tax is named after the
company’s state (US Sales Tax <state> <rate>%).
The check can be changed while the order is a quotation (sent or not)
and while the invoice is in draft. It is recomputed when the company,
the customer or the delivery address of the document changes, and on
sales orders also when the invoice address changes. Changing the company
setting, or the state or country of a customer, does not change existing
documents.
When the check is on and the delivery address is in a different state
from the company’s, the draft order or invoice shows a warning. It does
not block anything: uncheck Tax Based on Company Address to rate with
the delivery address instead.

Invoices:
- An invoice created from a sales order takes the order’s check. Orders
with a different value are never grouped in the same invoice.
- A credit note keeps the check of its invoice.
- Posting a customer invoice rates it again with its own check.

Special cases:
- Customer outside the United States: no US tax, as with the engine
alone, even if the check is on.
- Customer without an address (counter sale): rated with the company
address when the check is on. With Customers Without Address the
check comes on by itself. A customer with no address at all who is
really in another state is rated with the company address too, since
nothing on the record says otherwise: filter the calculation logs by
Tax Sourcing = Origin to list the documents rated this way and
complete those customers. Completing the address later does not change
existing documents: uncheck Tax Based on Company Address on the
draft ones.
- Company without a complete US address (5-digit ZIP, state and United
States as country) on a document with the check on: the draft document
shows a warning and the customer’s address is used.
In Invoicing > Configuration > US Sales Tax > Audit > Calculation
Logs, the Tax Sourcing column, also shown in the Address group of
each log, tells whether the rated address was the customer’s
(Destination) or the company’s (Origin). The address fields of the
log show the address actually rated.

- Mixed sourcing is not supported: the whole rate comes from a single
address. States such as California, which rate the state, county and
city share at the seller’s location and the district taxes at the
customer’s, are rated entirely with the company address when origin
sourcing is used.
- Supporting it needs the engine to resolve one address per jurisdiction
level, a natural follow-up of an address hook in the engine.
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.
This module is maintained by the OCA.
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 maintainers:

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.