From d2fad44e894b4bbbd1033d105e7e8d0c3b94c09c Mon Sep 17 00:00:00 2001 From: Diptanil Saha Date: Fri, 28 Feb 2025 22:36:24 +0530 Subject: [PATCH] fix: pos item detail serial no field (#46211) --- .../selling/page/point_of_sale/pos_item_details.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/pos_item_details.js b/erpnext/selling/page/point_of_sale/pos_item_details.js index 333b50810c9..e0abdd4f4c3 100644 --- a/erpnext/selling/page/point_of_sale/pos_item_details.js +++ b/erpnext/selling/page/point_of_sale/pos_item_details.js @@ -187,6 +187,7 @@ erpnext.PointOfSale.ItemDetails = class { this[`${fieldname}_control`].set_value(item[fieldname]); }); + this.resize_serial_control(item); this.make_auto_serial_selection_btn(item); this.bind_custom_control_change_event(); @@ -203,11 +204,17 @@ erpnext.PointOfSale.ItemDetails = class { "actual_qty", "price_list_rate", ]; - if (item.has_serial_no) fields.push("serial_no"); - if (item.has_batch_no) fields.push("batch_no"); + if (item.has_serial_no || item.serial_no) fields.push("serial_no"); + if (item.has_batch_no || item.batch_no) fields.push("batch_no"); return fields; } + resize_serial_control(item) { + if (item.has_serial_no || item.serial_no) { + this.$form_container.find(".serial_no-control").find("textarea").css("height", "6rem"); + } + } + make_auto_serial_selection_btn(item) { if (item.has_serial_no || item.has_batch_no) { if (item.has_serial_no && item.has_batch_no) { @@ -225,7 +232,6 @@ erpnext.PointOfSale.ItemDetails = class { `
${label}
` ); } - this.$form_container.find(".serial_no-control").find("textarea").css("height", "6rem"); } }