Daily updates from Odoo
Saturday, January 10, 2026
1 change · saas-19.1
Resolved issues and error corrections
This update significantly speeds up invoice processing by optimizing how the system determines parent IDs for account lines. Previously, a slow process caused memory errors with large invoices. Now, the update reduces processing time to approximately 4 seconds for invoices with 2000 lines, resolving a critical performance bottleneck.
Original PR description
Before this commit, computing the `parent_id` of `account.move.line` records, involved looping over the `move_lines` grouped by their `move_id` sorted by the `sequence`. The updates on the move_lines…
Before this commit, computing the `parent_id` of `account.move.line` records, involved looping over the `move_lines` grouped by their `move_id` sorted by the `sequence`. The updates on the move_lines are done per line and this involves an individual write operation on each one of them. The cardinality of the set of possible values of the new `parent_id` may involve a lot of values in cases where a big number of lines have a display type of either 'line_section' or 'line_subsection', in most of the cases it is not the case, so a possible performance improvement in the method is to upper bound the number of write operations by the cardinality of the set of possible values instead of a single write operation on each single `move_line`. This can be done by mapping the values to a record set of move lines and updating the move_lines that share the same value. The benchmark below is done on an invoice that contained **2000** `move.line` records. An individual **write** operation is being done on each one of them. | Scenario | Time (seconds) | |-----------|----------------| | **Before** | **Memory Error** | | **After** | **4s** | --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#239026