Tuesday, January 13, 2026
2 changes · 19.0
Resolved issues and error corrections
This update fixes a critical issue where payroll calculations continued even when errors were detected on payslips. Now, the system correctly raises an error, providing clear guidance on resolving the underlying problems, specifically addressing issues like missing contracts. This ensures accurate payroll processing and prevents incorrect calculations.
Original PR description
Bug: When there is an issue on a payslip with an error level, and we try to compute the sheet, the sheet is computed. Instead of computing, it should raise and the message should specify what errors need to be resolved first. Cause: When computing the sheet, we were calling the self._get_error_message() without using the result which is a string. Fix: Actually raise a ValidationError and use the result of self._get_error_message() for the error message. Introducing the raise brought other problems because some code supposed to fail was running seamlessly fine. But now, the raise is called and those needed to be solved as well. The issue raised multiple times is the "No contract in the payslip period". Task: 5153497
This update resolves a technical issue preventing the export of the General Ledger to XLSX format when multiple accounts are involved. The fix corrects a type mismatch that occurred during the summation of account data, ensuring accurate reporting for multi-account scenarios. This ensures the General Ledger report functions correctly for all users.
Original PR description
### Description Fixes a `TypeError` that occurs when exporting the general ledger to XLSX format with multiple accounts. ### Error TypeError: unsupported operand type(s) for +=: 'float' and 'str'…
### Description
Fixes a `TypeError` that occurs when exporting the general ledger to XLSX format with multiple accounts.
### Error
TypeError: unsupported operand type(s) for +=: 'float' and 'str'
File "/home/odoo/src/enterprise/account_reports/models/account_general_ledger.py", line 783, in export_to_xlsx
col['name'] += total_line['columns'][col_index]['name']
### Root Cause
This bug was introduced in commit 6a3804c5fe6 which added batching for general ledger XLSX exports. When summing total lines from multiple accounts, the code attempted to concatenate `col['name']` values.
When the report is generated with `no_format=True` context, the `name` field can be either:
- A `float` (numeric value)
- A `str` (formatted value)
This causes a type mismatch when trying to use the `+=` operator.
### Solution
Instead of trying to concatenate `name` values directly:
1. Sum only the numeric `no_format` values (which are always floats)
2. After summing, set `col['name'] = col['no_format']` to ensure type consistency
This maintains the correct total values while avoiding type errors.
### Steps to Reproduce
1. Open the General Ledger report
2. Select multiple accounts with transactions
3. Export to XLSX format
4. The export would fail with TypeError
### Impact
- **Severity**: High - prevents XLSX export of general ledger for multi-account scenarios
- **Version**: 17.0
- **Module**: account_reports
### Changes
- File: `account_reports/models/account_general_ledger.py`
- Line 783: Changed from `col['name'] += total_line['columns'][col_index]['name']` to `col['name'] = col['no_format']`