fix: cleanup dont_allow_new_row logic
diff --git a/erpnext/public/js/utils/barcode_scanner.js b/erpnext/public/js/utils/barcode_scanner.js
index c8a539d..25b4f62 100644
--- a/erpnext/public/js/utils/barcode_scanner.js
+++ b/erpnext/public/js/utils/barcode_scanner.js
@@ -11,10 +11,7 @@
this.batch_no_field = opts.batch_no_field || "batch_no";
this.qty_field = opts.qty_field || "qty";
this.max_qty_field = opts.max_qty_field || null;
- this.allow_new_row = opts.allow_new_row;
- if (this.allow_new_row === undefined || this.allow_new_row === null) {
- this.allow_new_row = true;
- }
+ this.dont_allow_new_row = opts.dont_allow_new_row;
this.items_table_name = opts.items_table_name || "items";
this.items_table = this.frm.doc[this.items_table_name];
@@ -77,7 +74,7 @@
}
if (!row) {
- if (!this.allow_new_row) {
+ if (this.dont_allow_new_row) {
frappe.show_alert({
message: __("Maximum quantity scanned for item {0}.", [item_code]),
indicator: "red"
diff --git a/erpnext/stock/doctype/pick_list/pick_list.js b/erpnext/stock/doctype/pick_list/pick_list.js
index ba14753..70e530c 100644
--- a/erpnext/stock/doctype/pick_list/pick_list.js
+++ b/erpnext/stock/doctype/pick_list/pick_list.js
@@ -165,7 +165,7 @@
items_table_name: 'locations',
qty_field: 'picked_qty',
max_qty_field: 'qty',
- allow_new_row: false
+ dont_allow_new_row: true
};
const barcode_scanner = new erpnext.utils.BarcodeScanner(opts);
barcode_scanner.process_scan();