fix: use serial batch fields not enabled for new stock entry

(cherry picked from commit dc9115a586)
This commit is contained in:
Rohit Waghchaure
2024-02-16 15:41:30 +05:30
committed by Mergify
parent bb77f85d89
commit 40d4e3261e
2 changed files with 35 additions and 1 deletions

View File

@@ -234,7 +234,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
}
set_fields_onload_for_line_item() {
if (this.frm.is_new && this.frm.doc?.items) {
if (this.frm.is_new() && this.frm.doc?.items) {
this.frm.doc.items.forEach(item => {
if (item.docstatus === 0
&& frappe.meta.has_field(item.doctype, "use_serial_batch_fields")