我正在使用 frappe python 客户端创建销售订单,但由于某种原因它没有被创建。我正在使用销售订单(和销售订单项目)的所有必填字段。它没有给出任何错误,但它甚至没有被创建。
我能够以类似的方式创建客户、送货地址、联系人甚至潜在客户,但创建销售订单不起作用。
当我尝试打印它时,它返回“无”。我在下面附上了我的代码。如果我缺少某些字段或任何内容,请告诉我?
忽略这些值,我在发布之前更改了它们。
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": [
{ # included 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,
}
]
})