I have a XLSX sheet which has the orders data…I want to read the xlsx and create the Sales Order using rest api…
what is the json format for successful creation of sales order…
Currently i have tried previously created Sales Order Json format ,But i am getting "ValidationError: Please enter ‘Expected Delivery Date’ " Error.
hi @KanchanChauhan
Thanks for the reply…i tried that format…Now I am getting following error
Traceback (most recent call last):
File “/home/jithendra/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.api.handle()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/api.py”, line 116, in handle
data.update({
AttributeError: ‘list’ object has no attribute ‘update’
i.e removing one braces (extra object)…i will get following error
Traceback (most recent call last):
File “/home/jithendra/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.api.handle()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/api.py”, line 120, in handle
“data”: frappe.get_doc(data).insert().as_dict()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 194, in insert
self._validate()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 401, in _validate
self._validate_links()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 626, in _validate_links
invalid_links, cancelled_links = self.get_invalid_links()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 494, in get_invalid_links
setattr(self, df.fieldname, values.name)
AttributeError: ‘NoneType’ object has no attribute ‘name’
My url : http://192.168.0.109:8000/api/resource/Sales Order
my json data : {
“customer”: “Mani V”,
“delivery_date”: “2017-03-30”,
“cust_address”: “Mani V”,
“items”: [{
“item_code”: “Lenovo Yoga 710 (14") Yoga 710 (14") 14" LAPTOP FOR ON-THE-GO CONNECTIVITY”,
“qty”: 2,
“rate”: 90000
}]
}
But I am Still getting the same error
Server Error
Traceback (most recent call last):
File “/home/jithendra/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.api.handle()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/api.py”, line 120, in handle
“data”: frappe.get_doc(data).insert().as_dict()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 194, in insert
self._validate()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 401, in _validate
self._validate_links()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/document.py”, line 626, in _validate_links
invalid_links, cancelled_links = self.get_invalid_links()
File “/home/jithendra/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 494, in get_invalid_links
setattr(self, df.fieldname, values.name)
AttributeError: ‘NoneType’ object has no attribute ‘name’
hi @makarand_b can u please tell that, do we need to write separate api for retrieving data from database. If yes, how to write and how to integrate this api to erpnext. I’m new to erpnext, if i get reply it will more helpful for me.