From 0b4b0874f42b5cf35f75f9006aa21bee47b65f17 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 29 Mar 2024 10:27:44 +0530 Subject: [PATCH] chore: show item name in the validation message (cherry picked from commit d05412f96a02352d1203758a52fb80a8327df45c) --- erpnext/public/js/utils/serial_no_batch_selector.js | 2 +- .../doctype/serial_and_batch_bundle/serial_and_batch_bundle.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/utils/serial_no_batch_selector.js b/erpnext/public/js/utils/serial_no_batch_selector.js index 42d37bf493b..1edeca95018 100644 --- a/erpnext/public/js/utils/serial_no_batch_selector.js +++ b/erpnext/public/js/utils/serial_no_batch_selector.js @@ -421,7 +421,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate { let { qty, based_on } = this.dialog.get_values(); if (this.item.serial_and_batch_bundle || this.item.rejected_serial_and_batch_bundle) { - if (qty === this.qty) { + if (this.qty && qty === Math.abs(this.qty)) { return; } } diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index 11018c27f67..a5da262242d 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py @@ -273,7 +273,8 @@ class SerialandBatchBundle(Document): def validate_negative_batch(self, batch_no, available_qty): if available_qty < 0: - msg = f"""Batch No {bold(batch_no)} has negative stock + msg = f"""Batch No {bold(batch_no)} of an Item {bold(self.item_code)} + has negative stock of quantity {bold(available_qty)} in the warehouse {self.warehouse}"""