Hi all,
I create a custom button to create a Delivery Note (automatically) from Sales Order and submit it (while creating)
Problem
while creating a Delivery Note the Sales Order status is not changed
- from (To Deliver To Bill) to (To Bill)
My Code
frappe.db.insert({
'doctype': 'Delivery Note',
'customer': frm.doc.customer,
'set_warehouse': frm.doc.set_warehouse,
'selling_price_list': 'Standard Selling',
'docstatus':1,
'items': frm.doc.items.map((item) => {
return {
'item_code' : item.item_code,
'item_name' : item.item_name,
'rate' : item.rate,
'qty':item.qty,
'against_sales_order': frm.doc.name
};
})
}).then(doc => {
console.log(doc.name)
frappe.show_alert("Delivery Note is created successfully")
});
Expected Result
My Code Result