Hi I am having the following error while creating a sales order with insert:
FrappeException: ["Traceback (most recent call last):\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/app.py\",
line 68, in application\n response = frappe.api.handle()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/api.py", line 140, in handle\n doc = frappe.get_doc(data).insert()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 239, in insert\n self._validate()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 493, in _validate\n self._validate_mandatory()\n File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 813, in _validate_mandatory\n name=self.name))\nfrappe.exceptions.MandatoryError: [Sales Order, SAL-ORD-2021-00040]: customer\n"]
indent preformatted text by 4 spaces
conn.insert({
"doctype": "Sales Order",
"order_type": "Sales",
"naming_series": "SAL-ORD-.YYYY.-",
"company": "Alima-Mexico",
"customer_name": "Alima Cliente",
"delivery_date": "1-1-2021",
"transaction_date": "1-1-2021",
"set_warehouse": "Producto terminado Yunque - AMX",
#"status": "Borrador",
"items": [{
"item_code": "VR00033",
"item_name": "Zarzamora",
"description":"Zarzamora",
"uom": "Kg",
"rate": 50.5,
"price_list_rate" : 50.5,
"qty": 1
}]
})