Submit all salary slip in Process Payroll: Journal Entry JV-00001: Cost Center is required for 'Profit and Loss'

Error message:

TypeError: ValidationError(“Journal Entry JV-00001: Cost Center is required for ‘Profit and Loss’ account 8001013 - Dummy - HRCAM. Please set up a default Cost Center for the Company.”,) is not JSON serializable

Company already set a default Cost Center.

You need to enter Cost Center in the Process Payroll form itself.

I have entered the Cost Center in the Process Payroll but the Cost Center doesn’t appear in Chart of Cost Centers tree node as I have deleted the Main cost centers :frowning: I cannot add cost center anymore.

I have removed cost center from db and update company record, cost center just created automatically but submit all salary slip in Process Payroll still getting error, even I set cost center to company and in process payroll form.

Is Cost Center you selecting in Process Payroll exists in db?

Yes, cost center in Process Payroll exist in db.

Is there any cost center bugs in ERPNext version below?

ERPNext: v8.5.4 (master)
Frappe Framework: v8.5.7 (master)