fix: Set barcode field empty only if it has value (#21425)

- To avoid unnecessary form dirty trigger
This commit is contained in:
Suraj Shetty 2020-04-26 23:25:40 +05:30 committed by GitHub
parent ded418e31d
commit 3e3a793567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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("");