From 3e3a793567813047aece67753019f09cff56c349 Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Sun, 26 Apr 2020 23:25:40 +0530 Subject: [PATCH] fix: Set barcode field empty only if it has value (#21425) - To avoid unnecessary form dirty trigger --- erpnext/public/js/controllers/transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 42964474b0a..5843034543b 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -288,7 +288,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ this.setup_sms(); this.setup_quality_inspection(); let scan_barcode_field = this.frm.get_field('scan_barcode'); - if (scan_barcode_field) { + if (scan_barcode_field && scan_barcode_field.get_value()) { scan_barcode_field.set_value(""); scan_barcode_field.set_new_description("");