Error after reloading a document using after_save

Hi all,

I added a this script to reload the document after saving a Salary Slip document in the Custom Script function.

frappe.ui.form.on(‘Salary Slip’, ‘after_save’, function(frm) {

However, I am getting and error which is as below.


Reloading manually does not trigger this error. Does anyone know why using that script will cause this ?

This is the traceback.

Traceback (most recent call last):
File “/home/myfiles/frappe-bench/apps/frappe/frappe/”, line 64, in application
response = frappe.api.handle()
File “/home/myfiles/frappe-bench/apps/frappe/frappe/”, line 58, in handle
return frappe.handler.handle()
File “/home/myfiles/frappe-bench/apps/frappe/frappe/”, line 30, in handle
data = execute_cmd(cmd)
File “/home/myfiles/frappe-bench/apps/frappe/frappe/”, line 70, in execute_cmd
return, **frappe.form_dict)
File “/home/myfiles/frappe-bench/apps/frappe/frappe/”, line 1117, in call
return fn(*args, **newargs)
File “/home/myfiles/frappe-bench/apps/frappe/frappe/”, line 101, in runserverobj
frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
File “/home/myfiles/frappe-bench/apps/frappe/frappe/desk/form/”, line 21, in runserverobj
doc = frappe.get_doc(json.loads(docs))
File “/usr/lib/python3.6/json/”, line 348, in loads
‘not {!r}’.format(
TypeError: the JSON object must be str, bytes or bytearray, not ‘NoneType’