fix: Cannot read property 'has_batch_no' of undefined

This commit is contained in:
Rohit Waghchaure
2020-06-10 17:04:40 +05:30
parent 8fcd86cb9e
commit c848b97757

View File

@@ -539,7 +539,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
if (show_batch_dialog) if (show_batch_dialog)
return frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"]) return frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
.then((r) => { .then((r) => {
if(r.message.has_batch_no || r.message.has_serial_no) { if(r.message &&
(r.message.has_batch_no || r.message.has_serial_no)) {
frappe.flags.hide_serial_batch_dialog = false; frappe.flags.hide_serial_batch_dialog = false;
} }
}); });