Merge pull request #40757 from rohitwaghchaure/fixed-validation-message

chore: show item name in the validation message
This commit is contained in:
rohitwaghchaure
2024-03-29 11:35:07 +05:30
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -421,7 +421,7 @@ erpnext.SerialBatchPackageSelector = class SerialNoBatchBundleUpdate {
let { qty, based_on } = this.dialog.get_values(); let { qty, based_on } = this.dialog.get_values();
if (this.item.serial_and_batch_bundle || this.item.rejected_serial_and_batch_bundle) { 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; return;
} }
} }

View File

@@ -268,7 +268,8 @@ class SerialandBatchBundle(Document):
def validate_negative_batch(self, batch_no, available_qty): def validate_negative_batch(self, batch_no, available_qty):
if available_qty < 0: 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 of quantity {bold(available_qty)} in the
warehouse {self.warehouse}""" warehouse {self.warehouse}"""