Hello Rushabh,
Need your expert advice here.
I followed the example to create invoice.
Here is shat happens, if i send multiple inserts for invoice like the example which sends invoice, taxes, items as branched doclists,
I get this error, even if there is just one doclist for sales invoice
"Traceback (innermost last):\n File \"../lib/webnotes/handler.py\",
line 156, in handle\n execute_cmd(cmd)\n File
\"../lib/webnotes/handler.py\", line 191, in execute_cmd\n ret =
call(method, webnotes.form_dict)\n File \"../lib/webnotes/handler.py\",
line 208, in call\n return fn(**newargs)\n File
\"../lib/webnotes/client.py\", line 49, in insert\n
doclist[0][\"__islocal\"] = 1\n TypeError: list indices must be
integers, not unicode\n"
note: in php, just encoding multidimensional array to the json
Eg: json object that throws this error
string '[{"naming_series":"INV","company":"Company","conversion_rate":1,"currency":"RRR","debit_to":"ABCD EFGH - CMP","customer":"ABCD EFGH","customer_name":"ABCD EFGH","doctype":"Sales Invoice","posting_date":"2013-04-24","due_date":"2013-04-24","fiscal_year":"2013-2014","grand_total":0,"grand_total_export":0,"net_total":0,"is_pos":1,"plc_conversion_rate":1,"price_list_currency":"RRR","price_list_name":"Standard","territory":"Default"}]'
And i just send the sales invoice doclist to insert - not branched
It creates a blank invoice with the customer name on it.
note: in php, just encoding single dimensional array to the json
Eg: json object that works
string '{"naming_series":"INV","company":"Company","conversion_rate":1,"currency":"RRR","debit_to":"ABCD EFGH - CMP","customer":"ABCD EFGH","customer_name":"ABCD EFGH","doctype":"Sales Invoice","posting_date":"2013-04-24","due_date":"2013-04-24","fiscal_year":"2013-2014","grand_total":0,"grand_total_export":0,"net_total":0,"is_pos":1,"plc_conversion_rate":1,"price_list_currency":"RRR","price_list_name":"Standard","territory":"Default"'
I have tried various combinations with and withouts those multiple doclists with same error always.
What am I doing wrong.