Friday, July 11, 2025
4 changes · 18.0
Enhancements to existing features
Saudi Arabia invoicing now prevents valid posted invoice PDFs from being deleted after they have been generated and sent to ZATCA, supporting auditability and compliance requirements. If a PDF was created while an invoice was rejected and the invoice is later accepted, the system can distinguish that older attachment and allow appropriate cleanup without resetting finalized records unnecessarily.
Original PR description
Task ID: 4730762 Description of the issue/feature this PR addresses: - As per ZATCA's auditability principles (clause 3 sub-heading C, paragraph 2): The Compliant E-Invoice solution must be able to…
Task ID: 4730762 Description of the issue/feature this PR addresses: - As per ZATCA's auditability principles (clause 3 sub-heading C, paragraph 2): The Compliant E-Invoice solution must be able to protect the generated Electronic Invoices and Electronic Notes from alteration or deletion. - This PR aims to restrict the deletion of valid invoice PDFs once the invoice has been generated & sent to ZATCA. Current Behavior before PR: - Invoice PDF attachments were allowed to be deleted in l10n_sa, even when the invoice is posted. - For l10n_sa_edi, if and invoice PDF is generated during a rejected state, it is kept there unless you reset to draft. Desired behavior after PR is merged: - in l10n_sa, deleting an attached invoice PDF raises a user error (reset to draft is required to detach the invoice first) - For l10n_sa_edi, if the invoice PDF is generated during a rejected state, but the invoice is resubmtited to ZATCA and accepted. The creation & write dates of the attachment linked & edi_documents respectively are compared and the deletion of the pdf attachment is allowed to be deleted in the case where the creation date was less than the write date. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Peppol invoice retrieval jobs now handle large invoice volumes by processing documents in smaller batches and automatically continuing when more work remains. This reduces the risk of scheduled jobs timing out, helping businesses with high transaction volumes keep electronic document processing running smoothly.
Original PR description
For database with big invoice volume, it is necessary to be able to retrieve documents in smaller batches otherwise crons will timeout due to the 15 minutes limit. Add a retrigger mechanic to the possibly heavy crons. opw-4925532 Forward-Port-Of: odoo/odoo#218383
Improves Profit and Loss report loading by avoiding unnecessary duplicate analytic accounting rows when no analytic plan is present. This reduces report processing time significantly, with benchmarks showing roughly twice as fast loading for grouped analytic account reports.
Original PR description
Description ----------- For the P&L report, a view of the `account_analytic_line` is created to mascarade as `account_move_line` for the reporting engine. The `analytic_distribution` is takens from…
Description ----------- For the P&L report, a view of the `account_analytic_line` is created to mascarade as `account_move_line` for the reporting engine. The `analytic_distribution` is takens from the plans of the analytic lines. This is done by collecting all potential plans a line can be associated with and *unnesting* them into the main table. Unnesting creates a duplicate of the row for each possible value of the analytic plans. This can quickly balloon the row count of the view, depending on how many plans are present. This also creates a duplicate row when the line isn't associated with a specific plan, adding the value `NULL` for the `analytic_distribution`. This commits filters out the `NULL` values of the array of plans before unnesting into the main table. Since on average an analytic line is associated with a few plans, this prevents the significant growth of the view, leading to more reasonable performance. Benchmark --------- On a database with ~700k AAL and ~600k AML for 2025, opening the P&L report with a grouping by analytic accounts, took: | Accounts count | Before | After | |----------------|----------|----------| | 1 | 10.3 sec | 4.76 sec | | 5 | 51 sec | 20.8 sec | | 10 | 96 sec | 41.7 sec | | 15 | 2:26 min | 1:04 min | | 20 | 3:15 min | 1:25 min | So roughly a ~2x improvement on average. Reference --------- opw-4845164
The manufacturing planning screen now reloads only the schedules currently visible to the user instead of processing all affected schedules in the background. This makes updates much faster for large, complex production plans, reducing a benchmarked reload from 31.6 seconds to 3.5 seconds.
Original PR description
Description ----------- Only fetch forecasts for MPS schedules visible in the view rather than all impacted schedules. Schedules not visible due to pagination are skipped when reloading the MPS state. Benchmark --------- Adjusting a quantity for a product, which will impact around 1k+ other schedules (hierarchy is deep with boms), `get_production_schedule_view_state` takes: | Before | After | Speed-up | |--------|-------|----------| | 31.6s | 3.5s | 9x | Reference --------- opw-4778588