Tuesday, October 1, 2024
1 change
Resolved issues and error corrections
This update corrects the journal type configuration for the Salaries journal in the Belgian payroll module. The journal was incorrectly set as "Miscellaneous" type while using an expense account, which caused payslip processing to fail. The journal type is now properly set to "Purchase" to match the expense account type, ensuring payroll operations work correctly.
Original PR description
In the PR https://github.com/odoo/odoo/pull/178494, I set default_account_id = None when the journal type is set to Miscellaneous. However, the runbot is failing for that PR. Upon further…
In the PR https://github.com/odoo/odoo/pull/178494, I set default_account_id = None when the journal type is set to Miscellaneous. However, the runbot is failing for that PR. Upon further investigation, I discovered that a Salaries journal was created with the type set to Miscellaneous and a default account of the expense type. I believe this is incorrect. If the default account is of the 'expense' type, the journal type should be set to Purchase instead.
Runbot Traceback :
```
Traceback (most recent call last):
File "/data/build/odoo/odoo/tools/convert.py", line 683, in _tag_root
f(rec)
File "/data/build/odoo/odoo/tools/convert.py", line 333, in _tag_function
_eval_xml(self, rec, env)
File "/data/build/odoo/odoo/tools/convert.py", line 204, in _eval_xml
return odoo.api.call_kw(model, method_name, args, kwargs)
File "/data/build/odoo/odoo/api.py", line 471, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/data/build/odoo/odoo/api.py", line 456, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/data/build/enterprise/l10n_be_hr_payroll/models/hr_payslip.py", line 547, in action_payslip_done
return super().action_payslip_done()
File "/data/build/enterprise/hr_payroll_expense/models/hr_payslip.py", line 67, in action_payslip_done
res = super(HrPayslip, self).action_payslip_done()
File "/data/build/enterprise/hr_payroll_account/models/hr_payroll_account.py", line 31, in action_payslip_done
self._action_create_account_move()
File "/data/build/enterprise/hr_payroll_account/models/hr_payroll_account.py", line 87, in _action_create_account_move
slip._prepare_adjust_line(line_ids, 'debit', debit_sum, credit_sum, date)
File "/data/build/enterprise/hr_payroll_account/models/hr_payroll_account.py", line 159, in _prepare_adjust_line
raise UserError(_('The Expense Journal "%s" has not properly configured the default Account!') % (self.journal_id.name))
odoo.exceptions.UserError: The Expense Journal "Salaries" has not properly configured the default Account!
```
Forward-Port-Of: odoo/enterprise#70712
Forward-Port-Of: odoo/enterprise#70486