Monday, September 14, 2026
1 change · saas-19.1
Enhancements to existing features
External tax values are now applied more efficiently by skipping an unnecessary clearing step before replacing taxes. This improves processing time for invoices with many lines, especially when using external tax services such as AvaTax, while keeping the same results.
Original PR description
[PERF] account_external_tax: avoid redundant tax clearing Avoid unnecessarily clearing `tax_ids` before setting the externally computed taxes, as the field is immediately replaced with the new tax…
[PERF] account_external_tax: avoid redundant tax clearing Avoid unnecessarily clearing `tax_ids` before setting the externally computed taxes, as the field is immediately replaced with the new tax values. Performance testing was performed using an invoice containing 200 lines with externally computed AvaTax taxes. Performance testing: | Metric | Before | After | |--------------------------------|--------|---------| | `_set_external_taxes()` | ~1:13 | ~43.77s | | Total external tax calculation | ~1:16 | ~46.66s | This reduces the execution time of `_set_external_taxes()` by approximately 40% for a 200-line invoice, while preserving the existing functional flow. The optimization is not specific to AvaTax and benefits the common `account.external.tax.mixin` flow when setting externally computed taxes on multiple lines. Profiler comparison: Before: <img width="1548" height="442" alt="image" src="https://github.com/user-attachments/assets/a5f2553c-a926-4324-88b2-743ed9214bf5" /> After: <img width="1429" height="440" alt="image" src="https://github.com/user-attachments/assets/c9c9c673-4654-4e11-b5f2-ffa4ecc87038" /> **opw-6472692** Forward-Port-Of: odoo/enterprise#130982