fix: cleanup dont_allow_new_row logic
This commit is contained in:
parent
5560ceca62
commit
7ae89dedd5
@ -11,10 +11,7 @@ erpnext.utils.BarcodeScanner = class BarcodeScanner {
|
|||||||
this.batch_no_field = opts.batch_no_field || "batch_no";
|
this.batch_no_field = opts.batch_no_field || "batch_no";
|
||||||
this.qty_field = opts.qty_field || "qty";
|
this.qty_field = opts.qty_field || "qty";
|
||||||
this.max_qty_field = opts.max_qty_field || null;
|
this.max_qty_field = opts.max_qty_field || null;
|
||||||
this.allow_new_row = opts.allow_new_row;
|
this.dont_allow_new_row = opts.dont_allow_new_row;
|
||||||
if (this.allow_new_row === undefined || this.allow_new_row === null) {
|
|
||||||
this.allow_new_row = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.items_table_name = opts.items_table_name || "items";
|
this.items_table_name = opts.items_table_name || "items";
|
||||||
this.items_table = this.frm.doc[this.items_table_name];
|
this.items_table = this.frm.doc[this.items_table_name];
|
||||||
@ -77,7 +74,7 @@ erpnext.utils.BarcodeScanner = class BarcodeScanner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!row) {
|
if (!row) {
|
||||||
if (!this.allow_new_row) {
|
if (this.dont_allow_new_row) {
|
||||||
frappe.show_alert({
|
frappe.show_alert({
|
||||||
message: __("Maximum quantity scanned for item {0}.", [item_code]),
|
message: __("Maximum quantity scanned for item {0}.", [item_code]),
|
||||||
indicator: "red"
|
indicator: "red"
|
||||||
|
|||||||
@ -165,7 +165,7 @@ frappe.ui.form.on('Pick List', {
|
|||||||
items_table_name: 'locations',
|
items_table_name: 'locations',
|
||||||
qty_field: 'picked_qty',
|
qty_field: 'picked_qty',
|
||||||
max_qty_field: 'qty',
|
max_qty_field: 'qty',
|
||||||
allow_new_row: false
|
dont_allow_new_row: true
|
||||||
};
|
};
|
||||||
const barcode_scanner = new erpnext.utils.BarcodeScanner(opts);
|
const barcode_scanner = new erpnext.utils.BarcodeScanner(opts);
|
||||||
barcode_scanner.process_scan();
|
barcode_scanner.process_scan();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user