The Wrong Tax Problem
Tax computation errors in Odoo are critical — they affect invoices, financial reports, and tax filings. When the computed tax does not match what you expect, the cause is almost always in the configuration rather than a software bug. This guide walks through every layer of Odoo's tax computation to find and fix the issue.
How Odoo Computes Taxes
The tax computation chain:
- Product has a default tax (Customer/Vendor Taxes on product form)
- Fiscal Position maps taxes to alternative taxes (or removes them)
- Tax record defines the rate and computation method
- Rounding method determines how decimals are handled
- Tax groups aggregate taxes on the invoice
Issues at any layer produce wrong amounts.
Cause 1: Wrong Tax Rate on Product
# Check the product's default taxes:
# Inventory → Products → select product → General Information tab
# Customer Taxes / Vendor Taxes field
# Common mistake: product has no tax assigned
# Or has the wrong tax (15% instead of 20%)
# Fix: Set the correct tax on the product
# For bulk updates:
# Export products → add/fix tax column → re-import
# Default tax for new products:
# Accounting → Configuration → Settings → Default Taxes
# Sale Tax / Purchase Tax → set your standard rateCause 2: Fiscal Position Override
Fiscal positions map one tax to another based on the customer's location or tax status.
# Example: Customer in EU with a valid VAT number
# Fiscal Position "Intra-Community" maps:
# 20% VAT → 0% (reverse charge)
# If the wrong fiscal position is applied:
# Invoice shows 0% tax instead of 20%, or vice versa
# Fix:
# 1. Check the invoice: Fiscal Position field
# 2. Check the customer: Sales & Purchase tab → Fiscal Position
# 3. Check auto-detection:
# Accounting → Configuration → Fiscal Positions
# Each position has rules based on country/state/VAT
# Common mistake: fiscal position removes all taxes
# Check: Fiscal Position → Tax Mapping tab
# Ensure the mapping has both "Tax on Product" and "Tax to Apply"Cause 3: Rounding Method
Odoo offers two rounding methods that produce different totals.
# Setting: Accounting → Configuration → Settings → Tax Rounding
# "Round per Line" vs "Round Globally"
# Round per Line: tax is rounded on each invoice line, then summed
# Round Globally: tax is computed on all lines, then rounded once
# Example with 3 lines of $10.05 at 10% tax:
# Round per Line: 3 × round(1.005) = 3 × 1.01 = $3.03
# Round Globally: round(3 × 1.005) = round(3.015) = $3.02
# Fix: Choose the method that matches your country's tax rules
# Most countries use Round Globally
# Some (e.g., Brazil) require Round per LineCause 4: Tax Included vs Excluded
# Tax can be computed on top of the price (excluded) or
# extracted from the price (included)
# Check: Accounting → Configuration → Taxes → select tax
# "Tax Computation" field:
# - "Fixed" — flat amount per unit
# - "Percentage of Price" — excludes tax from base
# - "Percentage of Price Tax Included" — price already includes tax
# - "Group of Taxes" — combines multiple taxes
# Common mistake: product price is tax-inclusive but tax is
# configured as tax-exclusive, double-charging tax
# Fix: Match the tax computation type to your pricing strategy
# B2C (consumer) → usually tax included in price
# B2B (business) → usually tax excluded from priceCause 5: Tax Group Misconfiguration
# Tax groups control how taxes display on invoices
# Multiple taxes in the same group are shown as one line
# Problem: Two different taxes in the same group look like one amount
# Making the total appear wrong
# Fix:
# Accounting → Configuration → Taxes → Tax Groups
# Ensure each distinct tax type has its own group
# Example groups: VAT 20%, VAT 10%, VAT 5%, ExemptCause 6: Multi-Currency Tax Issues
# Taxes on foreign currency invoices are converted using the
# exchange rate at the invoice date
# If the rate is wrong, the tax amount in your base currency is wrong
# Check: Accounting → Configuration → Currencies → select currency
# Rates tab → verify the rate for the invoice date exists
# Fix: Add or correct the exchange rate for the invoice date
# Or enable automatic rate updates:
# Settings → Currencies → Automatic Currency Rates → EnableCause 7: Tax Decimal Precision
# Odoo uses decimal precision settings that affect tax amounts
# Fix: Check decimal precision:
# Settings → Technical → Database Structure → Decimal Accuracy
# "Account" — precision for monetary amounts (usually 2)
# "Product Price" — precision for prices
# "Discount" — precision for discount percentages
# Changing precision after data exists can cause rounding issues
# Only change on a clean database or recalculate all invoicesCause 8: Tax on Discount
# When applying discounts, tax should be computed on the discounted price
# Example: $100 product, 10% discount, 20% tax
# Correct: ($100 - $10) × 20% = $18
# Wrong: $100 × 20% - $10 = $10 (discount applied to total, not base)
# Odoo computes correctly by default (tax on discounted amount)
# But custom modules or report templates may show it differently
# Verify in the invoice line:
# Subtotal = Price × Qty × (1 - Discount%)
# Tax = Subtotal × Tax RateDiagnosing Tax Issues
# 1. Check one invoice line in detail:
# Enable developer mode → open invoice line → check:
# - price_unit, quantity, discount
# - tax_ids (which taxes are applied)
# - price_subtotal (before tax)
# - price_total (after tax)
# 2. Compute tax manually and compare:
price = 100.00
qty = 2
discount = 10 # percent
tax_rate = 20 # percent
subtotal = price * qty * (1 - discount/100)
tax = subtotal * tax_rate / 100
print(f'Subtotal: {subtotal}, Tax: {tax}, Total: {subtotal + tax}')
# 3. Check fiscal position effect:
# Odoo shell:
invoice = env['account.move'].browse(INVOICE_ID)
for line in invoice.invoice_line_ids:
product_taxes = line.product_id.taxes_id
mapped_taxes = invoice.fiscal_position_id.map_tax(product_taxes)
print(f'{line.product_id.name}: {product_taxes.mapped("name")} → {mapped_taxes.mapped("name")}')