fix: correct logic for warehouse field label

(cherry picked from commit 72a38929e5)
This commit is contained in:
Sagar Vora
2025-08-26 00:29:26 +05:30
committed by Mergify
parent fbbd5a3af5
commit 0767c2e0f6

View File

@@ -512,7 +512,8 @@ erpnext.utils.BarcodeScanner = class BarcodeScanner {
handle_warehouse_scan(data) { handle_warehouse_scan(data) {
const warehouse = data.warehouse; const warehouse = data.warehouse;
const warehouse_field = this.get_warehouse_field(); const warehouse_field = this.get_warehouse_field();
const warehouse_field_label = frappe.meta.get_label(this.items_table_name, warehouse_field); const cur_grid = this.frm.fields_dict[this.items_table_name].grid;
const warehouse_field_label = frappe.meta.get_label(cur_grid.doctype, warehouse_field);
if (!this.last_scanned_warehouse_initialized) { if (!this.last_scanned_warehouse_initialized) {
this.setup_last_scanned_warehouse(); this.setup_last_scanned_warehouse();