payroll icon indicating copy to clipboard operation
payroll copied to clipboard

[15.0][16.0] payroll_account: Journal MISC Cannot have Default Account & Access Issue

Open hussain opened this issue 5 months ago • 0 comments

Describe the bug

In Payroll when a payslip is confirmed with rules linked to debit/credit accounts, confirming failed since there is no journal.default_account_id set in Journal. All journal of type miscellaneous will not allow selection of that account. The question is why action_payslip_done().

To Reproduce

Affected versions: 15.0 , 16.0 (might be earlier as well)

Steps to reproduce the behavior:

  1. Ensure you have an employee with running contract.
  2. Ensure salary structure have rules, and some rules are linked to debit/credit accounts
  3. Create a payslip of employee and compute, then confirm. 4.Popup error will show image

Case is tested in runbot in Payslip SLIP/001

Also if that account is set using server action, user cannot confirm since payslip will post journal entry. This call action_payslip_done should use sudo() ?

Expected behavior Payslip should be confirmed successfully. Error should be based on existing differences (if exist) and not to have an adjustment line in the journal entry, unless there is an analogy behind that.

hussain avatar Sep 17 '24 12:09 hussain