Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 57, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 935, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/advocate/advocate/advocate/doctype/supervisors/supervisors.py”, line 18, in get_sup_first
sup_first = frappe.db.sql(sql_query, as_dict=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 163, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 250, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 50, in defaulterrorhandler
raise errorvalue
ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '‘tabSupervisors’ WHERE \n advocate
= ‘test7’\n ORDER BY ‘first_nam’ at line 1”)
Code
frappe.ui.form.on(‘Advocate’, {
refresh: function(frm) {
frappe.call({
method: ‘advocate.advocate.doctype.supervisors.supervisors.get_sup_first’,
args: {
‘advocate’: frm.doc.name
},
callback: function(r) {
if (r.message) {
frm.set_value(‘supervisor_first_name’, r.message.sup_first[0]);
}
}
});
}
});