[hELP] PermissionError on Expense Claim Submission

Hello everyone,

I’m encountering an issue when trying to Submit an Expense Claim in ERPNext/Frappe. It seems to be related to the system calculating the reimbursed amount during the submission process.

Here is the traceback:

Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 121, in application
response = frappe.api.handle(request)
File “apps/frappe/frappe/api/init.py”, line 60, in handle
data = endpoint(**arguments)
File “apps/frappe/frappe/api/v1.py”, line 36, in handle_rpc_call
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 52, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1127, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/utils/typing_validations.py”, line 36, in wrapper
return func(*args, **kwargs)
File “apps/frappe/frappe/client.py”, line 188, in set_value
doc.save()
File “apps/frappe/frappe/model/document.py”, line 485, in save
return self._save(*args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 538, in _save
self.run_post_save_methods()
File “apps/frappe/frappe/model/document.py”, line 1326, in run_post_save_methods
self.run_method(“on_submit”)
File “apps/frappe/frappe/model/document.py”, line 1129, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1526, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1504, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/document.py”, line 1126, in fn
return method_object(*args, **kwargs)
File “apps/hrms/hrms/hr/doctype/expense_claim/expense_claim.py”, line 133, in on_submit
update_reimbursed_amount(self)
File “apps/hrms/hrms/hr/doctype/expense_claim/expense_claim.py”, line 398, in update_reimbursed_amount
total_amount_reimbursed = get_total_reimbursed_amount(doc)
File “apps/hrms/hrms/hr/doctype/expense_claim/expense_claim.py”, line 411, in get_total_reimbursed_amount
amount_via_jv = frappe.db.get_value(
File “apps/frappe/frappe/database/database.py”, line 554, in get_value
result = self.get_values(
File “apps/frappe/frappe/database/database.py”, line 653, in get_values
query = frappe.qb.get_query(
File “apps/frappe/frappe/query_builder/utils.py”, line 65, in get_query
return Engine().get_query(args, **kwargs)
File “apps/frappe/frappe/database/query.py”, line 110, in get_query
self.apply_fields(fields)
File “apps/frappe/frappe/database/query.py”, line 147, in apply_fields
self.fields = self.parse_fields(fields)
File “apps/frappe/frappe/database/query.py”, line 618, in parse_fields
sanitized_item = _sanitize_field(item.strip(), self.is_mariadb).strip()
File “apps/frappe/frappe/database/query.py”, line 1311, in _sanitize_field
_validate_select_field(field)
File “apps/frappe/frappe/database/query.py”, line 1300, in _validate_select_field
frappe.throw(
File “apps/frappe/frappe/utils/messages.py”, line 145, in throw
msgprint(
File “apps/frappe/frappe/utils/messages.py”, line 106, in msgprint
_raise_exception()
File “apps/frappe/frappe/utils/messages.py”, line 57, in _raise_exception
raise exc
frappe.exceptions.PermissionError: Invalid field format for SELECT: sum(debit_in_account_currency - credit_in_account_currency). Field names must be simple, backticked, table-qualified, aliased, or '
'.

Does anyone encounter in this kind of error for Expense Claim or Advance Claim?

I have already set on Accounts Manager and Account User as their role and permission. I don’t understand where I go wrong?