Merge pull request #22179 from rohitwaghchaure/code-cleanup-for-handling-batch-case-in-SI-develop

fix: Cannot read property 'has_batch_no' of undefined
This commit is contained in:
rohitwaghchaure 2020-06-10 17:57:07 +05:30 committed by GitHub
commit 496b6a28f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -552,7 +552,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
if (show_batch_dialog)
return frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
.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;
}
});