user in query report

20 views
Skip to first unread message

gangadhar kadam

unread,
May 9, 2013, 6:34:06 AM5/9/13
to erpnext-dev...@googlegroups.com
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
  1. Uncaught TypeError: Cannot read property 'length' of undefined
How can i implement this?

Thank you

Anand Doshi

unread,
May 9, 2013, 7:37:55 AM5/9/13
to erpnext-dev...@googlegroups.com
Hi Gangadhar,

Use script report for this. Refer to gross profit report to get some idea.

Thanks,
Anand.

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/xSu5x7bdYq4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages