I’m using frappe python client to create Sales Order but for some reason its not getting created. I’m using all mandatory fields for Sales Order (and Sales Order Item). Its not giving any error but its not even getting created.
I am able to create customer, address, contact, lead but creating sales order is not working.
Its returning “None” when I’m trying to print it.
I have attached my code below. Please do let me know if I am missing some fields or anything?
Ignore the values, I’ve changed them before posting here.
client = FrappeClient(apiConfig.erpNextUrl)
client.authenticate(apiConfig.erpNextApiKey, apiConfig.erpNextApiSecret)
sales_order = client.insert({
"doctype": "Sales Order",
"order_type": "Sales",
# "naming_series": "SAL-ORD-.YYYY.-",
"conversion_rate": 1.00,
"customer_name": "TEST",
"company": "TEST-COMPANY",
"transaction_date": str(date.today()),
"currency": "INR",
"selling_price_list": "state price",
"price_list_currency": "INR",
"plc_conversion_rate": 1.00,
"status": "Completed",
"set_warehouse": "some warehouse",
"delivery_date": "24-05-2021",
"grand_total": "₹ 1,800.00",
"items": [
{ # mandatory fields on ERP
"item_code": "some item code",
"item_name": "name of the item",
"uom": "Kg",
"description": "item description",
"conversion_factor": 1,
"qty": 3,
"price_list_rate": "₹ 700.00",
"rate": "₹ 700.00",
"amount": "₹ 2,100.00",
"stock_uom_rate": "₹ 700.00",
"net_rate": "₹ 600.00",
"net_amount": "₹ 1,800.00",
"billed_amt": "₹ 2,100.00",
"valuation_rate": "₹ 500.00",
"gross_profit": "₹ 600.00",
"projected_qty": 31,
"actual_qty": 42,
"delivered_qty": 3,
"ordered_qty": 0,
"work_order_qty": 0,
}
]
})