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

This causes other triggers and unnecessary changes (e.g. price list)
This commit is contained in:
Ankush Menat 2022-02-15 16:10:35 +05:30 committed by GitHub
parent 4a33cdab34
commit f89a64db48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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