Hello All, I have to user name for some condition in “query-report” like following
SELECT customer_name,delivery_address FROM tabCustomer WHERE refered_by IS NOT NULL and owner=‘%s’%(webnotes.session[‘user’])
i got following error
Traceback (innermost last):
File “…/lib/webnotes/handler.py”, line 154, in handle
execute_cmd(cmd)
File “…/lib/webnotes/handler.py”, line 189, in execute_cmd
ret = call(method, webnotes.form_dict)
File “…/lib/webnotes/handler.py”, line 206, in call
return fn(**newargs)
File “…/lib/webnotes/widgets/query_report.py”, line 61, in run
result = [list(t) for t in webnotes.conn.sql(report.query)]
File “…/lib/webnotes/db.py”, line 130, in sql
raise e
ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘[‘user’])’ at line 1”) all-app.min.js:307
Uncaught TypeError: Cannot read property ‘length’ of undefined
How can i implement this?
Thank you
–
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
Use script report for this. Refer to gross profit report to get some idea.
Thanks,
Anand.
On 09-May-2013, at 4:04 PM, gangadhar kadam <em...@gmail.com> wrote:
Hello All, I have to user name for some condition in "query-report" like following
SELECT customer_name,delivery_address FROM tabCustomer WHERE refered_by IS NOT NULL and owner='%s'%(webnotes.session['user'])
i got following error
Traceback (innermost last):
File "../lib/webnotes/handler.py", line 154, in handle
execute_cmd(cmd)
File "../lib/webnotes/handler.py", line 189, in execute_cmd
ret = call(method, webnotes.form_dict)
File "../lib/webnotes/handler.py", line 206, in call
return fn(**newargs)
File "../lib/webnotes/widgets/query_report.py", line 61, in run
result = [list(t) for t in webnotes.conn.sql(report.query)]
File "../lib/webnotes/db.py", line 130, in sql
raise e
ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '['user'])' at line 1")
all-app.min.js:307
Uncaught TypeError: Cannot read property 'length' of undefined
How can i implement this?
Thank you
–
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.