Daily updates from Odoo
Wednesday, August 7, 2024
5 changes · 17.0
Resolved issues and error corrections
Fixed a bug that prevented users with Hebrew language settings from opening documents in the Documents app. The issue was caused by automatic translation of a technical field name, which has been corrected by disabling translation for that specific field.
Original PR description
Current behaviour: --- When settings the user's language as hebrew, the user cannot open any documents Steps to reproduce: --- 1. My profile > Language > Hebrew 2. Go to Documents 3. Open any documents 4. Traceback Cause of the issue: --- file_extension would be literally translated Fix: --- Setting t-translation as off opw-3938083
This fix corrects a bug in the payroll test system where incorrect payslip data was being generated for Belgium payroll structures. The test utility was mistakenly using the wrong structure type parameter, causing tests to fail with incorrect data. This fix ensures payroll tests run correctly across different regional configurations.
Original PR description
The default _generate_payslip method is using structure type instead of structure. Therefore it generates wrong payslip under BE structure.
This fix corrects a configuration mismatch in the Australian payroll module that was causing installation failures. The module was using inconsistent terminology ("yearly" vs "anually") when defining pay period settings, which prevented the system from properly recognizing annual wage entries. This fix ensures the payroll module works correctly with annual salary configurations.
Original PR description
PERIODS_PER_YEAR is using "yearly" but hr_contract uses "anually" and since this model uses the hr_contract, we need to keep the same dictionary keys. In customer database the installation of the module is failing because cannot find key "anually". The issue would also happen if you just set a yearly wage opw-4083058
This fix resolves a system crash that occurred when the Chilean EDI authentication token was invalid or missing. The system was only checking for one type of invalid token (None) but not handling other invalid cases, causing automated workflows to fail. This update ensures the system properly handles all invalid token scenarios and prevents the crash.
Original PR description
Currently, a traceback may occur when we get the token as false Error:- ``` TypeError: can only concatenate str (not "bool") to str File "odoo/tools/safe_eval.py", line 390, in safe_eval return…
Currently, a traceback may occur when we get the token as false
Error:-
```
TypeError: can only concatenate str (not "bool") to str
File "odoo/tools/safe_eval.py", line 390, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(348,)", line 1, in <module>
File "home/odoo/src/enterprise/saas-17.2/l10n_cl_edi_stock/models/account_move.py", line 14, in cron_run_sii_workflow
super(AccountMove, self).cron_run_sii_workflow()
File "home/odoo/src/enterprise/saas-17.2/l10n_cl_edi/models/account_move.py", line 806, in cron_run_sii_workflow
self_skip._l10n_cl_ask_claim_status()
File "home/odoo/src/enterprise/saas-17.2/l10n_cl_edi/models/account_move.py", line 780, in _l10n_cl_ask_claim_status
move.l10n_cl_verify_claim_status()
File "home/odoo/src/enterprise/saas-17.2/l10n_cl_edi/models/account_move.py", line 288, in l10n_cl_verify_claim_status
response = self._get_dte_claim(
File "home/odoo/src/enterprise/saas-17.2/l10n_cl_edi/models/l10n_cl_edi_util.py", line 408, in _get_dte_claim
settings = Settings(strict=False, extra_http_headers={'Cookie': 'TOKEN=' + token})
ValueError: <class 'TypeError'>: "can only concatenate str (not "bool") to str" while evaluating
'model.cron_run_sii_workflow()'
File "odoo/addons/base/models/ir_cron.py", line 388, in _callback
self.env['ir.actions.server'].browse(server_action_id).run()
File "home/odoo/src/custom/trial/saas_trial/models/sentry.py", line 33, in run
res = super().run()
File "odoo/addons/base/models/ir_actions.py", line 971, in run
res = runner(run_self, eval_context=eval_context)
File "addons/website/models/ir_actions_server.py", line 61, in _run_action_code_multi
res = super(ServerAction, self)._run_action_code_multi(eval_context)
File "odoo/addons/base/models/ir_actions.py", line 801, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "odoo/tools/safe_eval.py", line 404, in safe_eval
raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
```
But here in the code, only the None case was handled. https://github.com/odoo/enterprise/blob/5dae45bea35b55e88e1d7199a555f9cc5375c899/l10n_cl_edi/models/l10n_cl_edi_util.py#L407-L410
After applying this commit it will resolve this issue by handling all the falsy cases for the token.
sentry-5539925394
Forward-Port-Of: odoo/enterprise#66232This fix resolves an issue in the Profit & Loss report that occurred when using negative analytical account percentages. When grouping by analytical accounts in the P&L report, the system was incorrectly validating amounts and causing errors. The fix removes an overly strict validation constraint from the temporary reporting table to allow proper handling of negative analytical distributions.
Original PR description
Problem: An issue arises due to a negative analytical distribution. If the analytical percentage is negative, its sign will match the sign of the amount_currency of its move line. However, in the…
Problem: An issue arises due to a negative analytical distribution. If the analytical percentage is negative, its sign will match the sign of the amount_currency of its move line. However, in the query that groups by the analytical account for P&L, the amount value is inverted. This does not cause a problem when the analytic percentage is positive because the amount_currency sign is opposite to the sign of the analytic line amount. But, in cases where the sign is the same, there will be a balance with a different sign than the amount, which will not comply with the constraint of the account.move.line table: "account_move_line_check_amount_currency_balance_sign". Steps to reproduce: 1. Activate "Analytic Accounting" in the settings 2. In an invoice, set an analytic distribution with a negative percentage 3. Validate the invoice 4. Go to P&L report an try to group by an analytic account 5. A validation error will occur. Proposed solution: Remove the constraint in the temporary table. opw-4092475 opw-4092232 opw-4086515 opw-4084850 opw-4083077 Forward-Port-Of: odoo/enterprise#67953