fix: dont attempt to set batch number if item doesn't have batch no (#29812) (#29813)

This causes other triggers and unnecessary changes (e.g. price list)

(cherry picked from commit f89a64db48)

Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2022-02-15 16:12:03 +05:30
committed by GitHub
parent 3e2b9a2c50
commit fd5ce9ca10

View File

@@ -227,11 +227,11 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
},
callback:function(r){
if (in_list(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
if (doc.doctype === 'Sales Invoice' && (!doc.update_stock)) return;
me.set_batch_number(cdt, cdn);
me.batch_no(doc, cdt, cdn);
if (has_batch_no) {
me.set_batch_number(cdt, cdn);
me.batch_no(doc, cdt, cdn);
}
}
}
});