You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
account_invoice_import: company default tax silently overrides the taxes parsed from the file #1393
In wizard/account_invoice_import.py (16.0, checked on 76c2cc0):
_last_update_import_config() (l.544-550) injects company.account_purchase_tax_id into import_config["taxes"] when the partner has no import config;
in the line loop (l.455-460), the config taxes take precedence over bdio._match_taxes() on the parsed file taxes (if not taxes: only) — so with a company default set, the file's taxes are never looked at.
Consequence: a multi-rate invoice (e.g. 5.5% + 20%) is imported with the default tax on every line; the total VAT is then "forced" to match, silently producing a wrong per-rate breakdown. Worst case for a French construction buyer: a subcontractor invoice under domestic reverse charge (AE, 0%) imported with the default 20% VAT.
Suggested fix (~4 lines): don't apply the company default when parsed_inv["lines"] carry taxes, restoring the intended priority product > partner config > file > company default. Caveat for the implementer: the "Cleanup" block further down accesses import_config["taxes"] without .get(), so the key must still be set.
This is addressed on 18.0 by #1407 (merged 9 September), and #1409 backports it to 16.0: taxes parsed from the file are now matched first, then the product's, and the import config — where the company default ends up — only as a last resort.
One difference from the order you suggested: file taxes now also take precedence over product taxes, not only over the company default.
Activity
akarazhev commentedon Sep 24, 2026
This is addressed on 18.0 by #1407 (merged 9 September), and #1409 backports it to 16.0: taxes parsed from the file are now matched first, then the product's, and the import config — where the company default ends up — only as a last resort.
One difference from the order you suggested: file taxes now also take precedence over product taxes, not only over the company default.