Daily updates from Odoo
Sunday, August 31, 2025
1 change · 18.0
Resolved issues and error corrections
This fixes a Mexican e-invoicing issue where sales orders could show zero invoiced quantity after a CFDI invoice cancellation workflow. The system now refreshes the invoiced quantity when the CFDI status changes, keeping sales order information accurate for follow-up billing and reporting.
Original PR description
How to reproduce the issue: In l10n_mx: 1. Create a sale order. 2. Create an invoice from the SO, with yesterday’s date, and send it to the CFDI. 3. Lock the period at yesterday’s date. 4. Request the invoice cancellation with the “01” method. This creates a new invoice — confirm it. 5. Create a credit note for the original invoice. 6. Retry sending the cancel request to the CFDI; the CFDI state is now cancelled for the original invoice. On the original SO, the quantity invoiced is 0 despite the CFDI state of the original invoice being cancelled. This commit forces a recompute of the quantity invoiced when the CFDI state changes. Since _compute_qty_invoiced uses _get_invoice_lines, which filters out invoices in sent state, only lines from invoices in cancelled state will be taken into account. opw-4910139 Forward-Port-Of: odoo/enterprise#91924