Error when submitting expense claim

After the recent update to v12.9.2, we have problem submitting the expense claim. The system prompts us the following:

From browser console I saw it is because of pl_must_have_cost_center in

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 62, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 56, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 61, in execute_cmd
return, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 1055, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 105, in apply_workflow
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 867, in submit
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 856, in _submit
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 273, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 326, in _save
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 930, in run_post_save_methods
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 797, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 1067, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 1050, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/”, line 791, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/expense_claim/”, line 69, in on_submit
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/expense_claim/”, line 101, in make_gl_entries
make_gl_entries(gl_entries, cancel)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/”, line 24, in make_gl_entries
save_entries(gl_map, adv_adj, update_outstanding, from_repost)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/”, line 128, in save_entries
make_entry(entry, adv_adj, update_outstanding, from_repost)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/”, line 143, in make_entry
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/gl_entry/”, line 30, in validate
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/gl_entry/”, line 77, in pl_must_have_cost_center
.format(self.voucher_type, self.voucher_no, self.account))
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 377, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 356, in msgprint
File “/home/frappe/frappe-bench/apps/frappe/frappe/”, line 316, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: Expense Claim EXP00674: Cost Center is required for ‘Profit and Loss’ account Telephone Expenses - IB. Please set up a default Cost Center for the Company.

This wasn’t happening before the upgrade. And I have checked some discussions in the forum and I have confirmed the Default Expense Claim Payable Account is already set to Creditors in the company but it won’t help.

The only way to to get rid of this error is to select Cost Center for every items in the expense claim form (which we did not need to do that before the upgrade).

Does it become the norm now, or have I missed something?


I don’t have this in front of me to test right now, but did you try setting a default cost center in your company page?

I always have the default cost center in company setting.

I can confirm that we are also experiencing the exact same issue today as well. We upgraded last week to v12.9.3 and had the same error message when trying to post expense reports this morning.

“Expense Claim EXP00096: Cost Center is required for ‘Profit and Loss’ account 5160 - Expensed Job Costs - AV8. Please set up a default Cost Center for the Company.”

We also went to the company list and confirmed that the Default Cost Center is still set to Main-AV8. All other default account settings are still there as well.

I would like to point out that if I open the drop down for the individual line in the expense claim that there are now TWO cost centers I can select. Until now there has only been the Main-AV8 cost center. Now there is one called Av8 Technologies-AV81 I do not recall setting up a second cost center ever. This was created on it’s own.

I went to the Cost Center Tree and see that there is no cost center called AV8 Technologies-AV81, but it is offered up as one in the dialog box in the expense report. I think this bug needs to be addressed.

Hi @peterg,

Any update? However can we fix this?



For now manually select the child node of the cost center in each record (row). That should work. We will get the filters fixed.

Thank you for reporting.

Unfortunately, I don’t have any instance of v12.9.2 running to check.

I’m not able to reproduce the issue on 13-beta, which is good news I think though not something that helps you immediately. Until a fix comes in, in addition to just setting it manually (which is tedious), you could always set the default value for the Expense Claim Detail doctype via the Customize Form tool. Would that help as a short-term fix?

Yes, the issue is fixed in the develop branch. We will release a fix for v12 soon.

1 Like

@peterg Yes. I have set the default value for the Expense Claim Detail doctype via the Customize Form tool since after I discovered the problem. So I just reported it to see whether it is the new behavior now or bug :slight_smile:

I will wait patiently for the fix in v12. Thanks @michelle


The issue had been fixed.
Pull request: fix: Child is shown in Parent process if added from tree view by Anurag810 · Pull Request #22219 · frappe/erpnext · GitHub