From 2e919344df8cd9018b2fff6d70b49c8db6ba0d8c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 28 Dec 2023 18:54:38 +0530 Subject: [PATCH] fix: auto fetch not working if bundle exists (backport #39002) (#39004) fix: auto fetch not working if bundle exists (#39002) (cherry picked from commit b5340c5ec0d418dcf764efa961f743f88b660a24) Co-authored-by: rohitwaghchaure --- erpnext/public/js/utils/serial_no_batch_selector.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index 4cd1243413..bf362e338e 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -337,16 +337,18 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate { } get_auto_data() { + let { qty, based_on } = this.dialog.get_values(); + if (this.item.serial_and_batch_bundle || this.item.rejected_serial_and_batch_bundle) { - return; + if (qty === this.qty) { + return; + } } if (this.item.serial_no || this.item.batch_no) { return; } - let { qty, based_on } = this.dialog.get_values(); - if (!based_on) { based_on = 'FIFO'; }