diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index c8b48a5635..3d174b78f7 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -198,6 +198,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ }, callback:function(r){ if (in_list(['Delivery Note', 'Sales Invoice'], doc.doctype)) { + me.set_batch_number(cdt, cdn); me.batch_no(doc, cdt, cdn); } } @@ -367,6 +368,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ callback: function(r) { if(r.message) { frappe.model.set_value(doc.doctype, doc.name, 'batch_no', r.message); + } else { + frappe.model.set_value(doc.doctype, doc.name, 'batch_no', r.message); } } });