refactor: dont harcode "serial_no" field

This commit is contained in:
Ankush Menat 2022-03-28 10:19:22 +05:30 committed by Ankush Menat
parent 98468fab18
commit b58b1343bb

View File

@ -145,7 +145,8 @@ erpnext.utils.BarcodeScanner = class BarcodeScanner {
}
is_duplicate_serial_no(row, serial_no) {
const is_duplicate = !!serial_no && !!row.serial_no && row.serial_no.includes(serial_no);
const is_duplicate = !!serial_no && !!row[this.serial_no_field]
&& row[this.serial_no_field].includes(serial_no);
if (is_duplicate) {
frappe.show_alert(