Tuesday, November 11, 2025
4 changes · 18.0
Enhancements to existing features
This change speeds up how Odoo calculates amounts on accounting entries by loading needed data more efficiently. It reduces waiting time, memory use, and database calls when processing large reconciliations, which should make accounting operations noticeably faster.
Original PR description
Currently performance on `_compute_amount()` is bottlenecked by `__get__()` calls on fields on `line_ids`. We tackle this bottleneck by warming the cache with `fetch()` Benchmark on reconciling 2 account moves with ~70k lines each | |Total Time|Allocated Memory|Queries| |----------|----------|----------------|-------| |Before |43.23s |2GB |993 | |After |18.60s |1GB |693 | opw-5098543 Forward-Port-Of: odoo/odoo#234656
Resolved issues and error corrections
This change adds a validation step before an invoice is posted to make sure its line accounts belong to the same company. It prevents invoices from being confirmed with mismatched company data, which could otherwise cause accounting errors across companies.
Original PR description
**Steps to reproduce:** - Create Company A and Company B - Create an invoice on Company A with one line having an account in Company A. - On the same invoice, change the company to Company B and change the journal to a journal of Company B. - Save, then confirm the invoice. **Issue:** The invoice, now belonging to Company B, still has the same account from company A, and we are able to post it on the journal from company B. **Solution:** Adding a step to check if the companies are correct on the move lines before posting. opw-5167958 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#234357
This update prevents an error that could block invoicing when a previously billed subscription line had been deleted. In those cases, the system now safely uses the invoice line’s own unit of measure so subscription billing can continue normally.
Original PR description
**Issue** When a subscription order line is deleted after being invoiced, attempting to create a new invoice for the subscription raises a UserError about UoM category mismatch. Video:…
**Issue** When a subscription order line is deleted after being invoiced, attempting to create a new invoice for the subscription raises a UserError about UoM category mismatch. Video: https://drive.google.com/file/d/11-CV7wcEHQJFoVEQM5o5YBkZuTXPYDqL/view **Steps to Reproduce** 1. Create and confirm a subscription with a recurring product (e.g., Car Leasing) 2. Generate and post the invoice for the subscription 3. Add a new product line to the subscription (e.g., Office Cleaning Service) 4. Delete the original invoiced line (Car Leasing) 5. Attempt to create an invoice for the new product line → Error: "The unit of measure Units defined on the order line doesn't belong to the same category as the unit of measure False defined on the product. Please correct the unit of measure defined on the order line or on the product, they should belong to the same category." (https://drive.google.com/file/d/11-CV7wcEHQJFoVEQM5o5YBkZuTXPYDqL/view) **Root Cause** Commit https://github.com/odoo/enterprise/commit/22e49fca1e0fbfefac974c562491d170b8d70025 introduced quantity tracking per period in _get_max_invoiced_date() to fix partial credit note handling. The implementation accesses `sale_line_ids.product_uom` assuming sale_line_ids is always populated. However, when a sale order line is deleted, the related account.move.line remains in the system with empty sale_line_ids. Accessing `sale_line_ids.product_uom` on an empty recordset returns False, causing the UoM validation to fail during invoice creation. **Fix** Add a fallback to use the invoice line's own product_uom_id when sale_line_ids is empty. This preserves the partial credit note fix from https://github.com/odoo/enterprise/commit/22e49fca1e0fbfefac974c562491d170b8d70025 while handling the edge case of deleted subscription lines. If no valid UoM is found, the line is skipped in the calculation.
The document layout preview and invoice/report previews now show the company Tax ID correctly. This ensures what users see before printing matches the final document and avoids confusion or rework.
Original PR description
**Steps to reproduce:** 1. Enable debug mode. 2. Go to Settings → Companies → Configure Document Layout. 3. Add a Tax ID and save. 4. Preview the document layout. 5. Print or preview any invoice. **Observed behavior:** * Tax ID was missing from the layout preview. * Tax ID was missing from the external report preview. **Cause:** * The Tax ID value was not passed correctly to the templates, so it never appeared in the rendered layouts or previews. **Fix:** * Include the Tax ID in the layout rendering context. * Adjust layout spacing to prevent overlap in report previews. opw-5154255