Daily updates from Odoo
Saturday, December 13, 2025
1 change · master
Resolved issues and error corrections
This update fixes a bug in the Arabic financial reports that was causing incorrect balance calculations due to duplicate account entries. A missing 'DISTINCT' clause in a database query was incorrectly processing multiple account tags, leading to inaccurate report totals. The fix ensures accurate financial reporting for Arabic VAT book exports.
Original PR description
For ease of reuse, we use a CTE to find the operation type of the lines we care about. This works great however, a `DISTINCT ON (aml.id)` was missed on the CTE as if an account had multiple tags associated with it, it would end up appearing multiple times and multiplying the total balance by the number of tags, making the report wrong. We need to use a special CASE in the order by because we want to prioritize the right account tag on the account that way we can properly determine when to set the operation type to whatever it needs to be. The same issue appears in both the purchase and sales exports, so it has been fixed in both queries. opw-5406043 Forward-Port-Of: odoo/enterprise#101875