refactor: serial no normalization
This commit is contained in:
@@ -341,10 +341,36 @@ erpnext.buying.BuyingController = class BuyingController extends erpnext.Transac
|
||||
}
|
||||
frappe.throw(msg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
update_serial_batch_bundle(doc, cdt, cdn) {
|
||||
let item = locals[cdt][cdn];
|
||||
let me = this;
|
||||
let path = "assets/erpnext/js/utils/serial_no_batch_selector.js";
|
||||
|
||||
frappe.db.get_value("Item", item.item_code, ["has_batch_no", "has_serial_no"])
|
||||
.then((r) => {
|
||||
if (r.message && (r.message.has_batch_no || r.message.has_serial_no)) {
|
||||
item.has_serial_no = r.message.has_serial_no;
|
||||
item.has_batch_no = r.message.has_batch_no;
|
||||
|
||||
frappe.require(path, function() {
|
||||
new erpnext.SerialNoBatchBundleUpdate(
|
||||
me.frm, item, (r) => {
|
||||
if (r) {
|
||||
me.frm.refresh_fields();
|
||||
frappe.model.set_value(cdt, cdn,
|
||||
"serial_and_batch_bundle", r.name);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
cur_frm.add_fetch('project', 'cost_center', 'cost_center');
|
||||
|
||||
Reference in New Issue
Block a user