Daily updates from Odoo
Sunday, July 12, 2026
2 changes · master
Enhancements to existing features
Peruvian electronic invoices can now correctly handle ISC taxes charged as a fixed amount per unit, helping businesses comply with SUNAT requirements. The update also prevents incorrect negative tax bases when ISC-taxed lines are mixed with exempt or unrelated tax lines, reducing invoice rejection risk.
Original PR description
## Summary - Add ISC fixed amount per unit (SUNAT Catalog No. 08, system type 02) support to Peru UBL 2.1 XML generation - Emit `BaseUnitMeasure` and `PerUnitAmount` at line-level `TaxSubtotal` for…
## Summary - Add ISC fixed amount per unit (SUNAT Catalog No. 08, system type 02) support to Peru UBL 2.1 XML generation - Emit `BaseUnitMeasure` and `PerUnitAmount` at line-level `TaxSubtotal` for ISC tipo 02; emit `TierRange` inside `TaxCategory` for all ISC tipos (01/02/03) - Compute effective `cbc:Percent` for ISC tipo 02 as `TaxAmount / TaxableAmount × 100` rounded to 5 decimals (SUNAT rules 3102, 3104, 3108) - Merge ISC variants into a single document-level `TaxSubtotal` (SUNAT rule 3068 — tax code 2000 must not repeat at totals); re-emit `TierRange`/`Percent` at doc level only when all lines share one tipo - Add tests and XML fixture covering pure tipo 02 and mixed tipo 01+02 invoices ## Context Peru's ISC tax supports three application systems defined in SUNAT Catalog No. 08: - **01** — Sistema al Valor (percentage on base) — already supported - **02** — Aplicación de Monto Fijo (fixed amount per unit) — **this PR** - **03** — Sistema de Precios de Venta al Público ISC tipo 02 requires specific UBL nodes per SUNAT specification: `BaseUnitMeasure`, `PerUnitAmount` (at `TaxSubtotal` level) and `TierRange` (inside `TaxCategory`). ### SUNAT validation rules for ISC Percent For ISC (tax code 2000), SUNAT validates `cbc:Percent` with three rules: - **3102** — format must be max 3 integer digits and up to 5 decimal digits - **3104** — value must be different from 0.00 (when `TaxableAmount > 0`) - **3108** — `Percent/100 × TaxableAmount = TaxAmount` (tolerance ±1) For ISC tipo 02 (fixed amount), the per-unit amount cannot be placed directly in `Percent` because the validation formula `Percent × TaxableAmount` would fail. Instead, we compute the **effective percentage**: `TaxAmount / TaxableAmount × 100`, which satisfies all three rules. ### SUNAT rule 3068 — single tax code at document totals When an invoice combines multiple ISC variants (e.g., tipo 01 on one line + tipo 02 on another), they share `TaxScheme/ID = 2000` and SUNAT rejects the document because the same tax code repeats in `cac:TaxTotal` at document totals. To fix this, `l10n_pe_edi_isc_type` is dropped from the doc-level grouping key so all ISC entries collapse into a single `TaxSubtotal` whose `TaxAmount` and `TaxableAmount` are the sum of every ISC variant. `TierRange`/`Percent` are intentionally omitted at doc level when types are mixed (a merged value cannot represent both tipos). Per-line `TaxSubtotal` nodes still carry their own `TierRange`/`Percent` per tipo. When the invoice uses a single tipo, the type is restored at doc-level render time so existing single-tipo invoices keep their previous output unchanged. ### Line and document base totals ISC fixed taxes are already excluded from `LineExtensionAmount` and `TaxExclusiveAmount` because `l10n_pe_edi` sets `fixed_taxes_as_allowance_charges = False` (introduced upstream in commit `d07ca711bf7` to fix ICBPER). This PR relies on that behavior; no additional subtraction is performed in the Peru EDI code. ## Legal references - SUNAT CPE UBL 2.1 specification: https://cpe.sunat.gob.pe/sites/default/files/inline-files/guia%2Bxml%2Bnota%20de%20cr%C3%A9dito%2Bversion%202-1%2B1%2B0_0_0%20%282%29.pdf - SUNAT Catalog No. 08 (ISC System Type): https://www.sunat.gob.pe/legislacion/superin/2017/anexoE-245-2017.pdf - Peru Tax Code Art. 50 — ISC application systems: https://www.sunat.gob.pe/legislacion/igv/ley/capitul2.htm - SUNAT Validation Rules (CPE v2026-02-12): AjustesValidacionesCPEv20260212.xlsx — rules 3068, 3102, 3104, 3108 ## Example ISC fixed amount tax configuration (tipo 02 — Aplicación de Monto Fijo): <img width="1206" height="694" alt="ISC fixed amount tax config" src="https://github.com/user-attachments/assets/87bd23a8-5c5a-42bc-9512-6c19ee45b96d" /> ISC percentage tax configuration (tipo 01 — Sistema al Valor, existing behavior): <img width="1206" height="694" alt="ISC percentage tax config" src="https://github.com/user-attachments/assets/95e5e914-08d4-4b01-abf3-e5b6159079aa" /> Invoice with ISC fixed amount (tipo 02) — successfully sent to SUNAT: <img width="1789" height="857" alt="Invoice with ISC fixed amount sent to SUNAT" src="https://github.com/user-attachments/assets/66f89c51-7aac-4a17-a3d3-cc02629fd3f9" /> Invoice with ISC percentage (tipo 01) — backward compatibility confirmed: <img width="1789" height="857" alt="Invoice with ISC percentage backward compatible" src="https://github.com/user-attachments/assets/9e99387c-b6ed-43aa-8e56-a25e24685172" /> Invoice with ISC — SUNAT validation passed: <img width="1789" height="857" alt="Credit note with ISC validated by SUNAT" src="https://github.com/user-attachments/assets/ada2016a-aece-404e-b2f1-50193d9eac72" /> ## Functional testing (edge cases validated) | Case | qty | price | ISC/unit | Effective Percent | SUNAT | |------|-----|-------|----------|-------------------|-------| | Base case | 50 | 100 | 10.00 | 10.0 | ✅ | | Different price | 5 | 123 | 2.70 | 2.19512 | ✅ | | High price | 1 | 530 | 2.70 | 0.50943 | ✅ | | Very high price | 1 | 99999 | 2.70 | 0.0027 | ✅ | | Price < ISC | 5 | 2.00 | 10.00 | 500.0 | ✅ | | Mixed tipo 01+02 (rule 3068) | — | — | — | per line: 17.0 / 2.19512; doc-level: merged into one ISC `TaxSubtotal` (`TierRange`/`Percent` omitted) | ✅ | | Tipo 02 + solo IGV | — | — | — | 0.50943 | ✅ |
The messaging-related menus for WhatsApp and connected apps are being consolidated into one clearer entry point. This makes navigation more consistent for users and reduces duplicated menu behavior across AI, Documents, Knowledge, and WhatsApp areas.
Original PR description
community https://github.com/odoo/odoo/pull/269104