Recently I’m exploring the frappe education app. During creating a new Fee Schedule I’m encountering the below message.
Is this an issue or I’m not doing it properly?
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 63, in handle
data = endpoint(**arguments)
File “apps/frappe/frappe/api/v1.py”, line 40, in handle_rpc_call
return frappe.handler.handle()
~~~~~~~~~~~~~~~~~~~~~^^
File “apps/frappe/frappe/handler.py”, line 53, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 86, in execute_cmd
return frappe.call(method, **frappe.form_dict)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1124, 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/desk/form/save.py”, line 43, in savedocs
doc.save()
~~~~~~~~^^
File “apps/frappe/frappe/model/document.py”, line 518, in save
return self._save(*args, **kwargs)
~~~~~~~~~~^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 540, in _save
return self.insert()
~~~~~~~~~~~^^
File “apps/frappe/frappe/model/document.py”, line 447, in insert
self.run_before_save_methods()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File “apps/frappe/frappe/model/document.py”, line 1332, in run_before_save_methods
self.run_method(“validate”)
~~~~~~~~~~~~~~~^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1181, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1578, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/document.py”, line 1556, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
~~^^^^^^^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/document.py”, line 1178, in fn
return method_object(*args, **kwargs)
File “apps/education/education/education/doctype/fee_schedule/fee_schedule.py”, line 62, in validate
self.validate_total_against_fee_strucuture()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File “apps/education/education/education/doctype/fee_schedule/fee_schedule.py”, line 115, in validate_total_against_fee_strucuture
frappe.db.get_all(
~~~~~~~~~~~~~~~~~^
“Fee Schedule”,
^^^^^^^^^^^^^^^
filters={“fee_structure”: self.fee_structure},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fields=[“sum(total_amount) as total”],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)[0][“total”]
^
File “apps/frappe/frappe/database/database.py”, line 828, in get_all
return frappe.get_all(*args, **kwargs)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/init.py”, line 1382, in get_all
return get_list(doctype, *args, **kwargs)
File “apps/frappe/frappe/init.py”, line 1357, in get_list
return frappe.model.qb_query.DatabaseQuery(doctype).execute(*args, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File “apps/frappe/frappe/model/qb_query.py”, line 203, in execute
query = frappe.qb.get_query(**kwargs)
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 294, in get_query
self.apply_fields(fields)
~~~~~~~~~~~~~~~~~^^^^^^^^
File “apps/frappe/frappe/database/query.py”, line 348, in apply_fields
self.fields = self.parse_fields(fields)
~~~~~~~~~~~~~~~~~^^^^^^^^
File “apps/frappe/frappe/database/query.py”, line 1061, in parse_fields
if sanitized_item := _validate_select_field(item.strip()):
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File “apps/frappe/frappe/database/query.py”, line 1953, in _validate_select_field
frappe.throw(
~~~~~~~~~~~~^
_(
^^
…<2 lines>…
frappe.ValidationError,
^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “apps/frappe/frappe/utils/messages.py”, line 148, in throw
msgprint(
~~~~~~~~^
msg,
^^^^
…<6 lines>…
primary_action=primary_action,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File “apps/frappe/frappe/utils/messages.py”, line 109, in msgprint
_raise_exception()
~~~~~~~~~~~~~~~~^^
File “apps/frappe/frappe/utils/messages.py”, line 58, in _raise_exception
raise exc
frappe.exceptions.ValidationError: SQL functions are not allowed as strings in SELECT: sum(total_amount) as total. Use dict syntax like {‘COUNT’: ''} instead.
Frappe Framework: v16.1.1 (version-16)
Payments: v0.0.1 (develop)
ERPNext: v17.x.x-develop (7cbd644) (develop)
Education: v15.5.3 (develop)
