From 810c72a30c6f06b19ae1f606b22c0df8fa0dc7b2 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 29 Nov 2024 18:12:48 +0530 Subject: [PATCH] fix: number format in the message (#44435) --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 9b07c1e4d19..fff9cbfc07d 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 @@ -607,8 +607,10 @@ class SerialandBatchBundle(Document): precision = row.precision if abs(abs(flt(self.total_qty, precision)) - abs(flt(qty, precision))) > 0.01: + total_qty = frappe.format_value(abs(flt(self.total_qty)), "Float", row) + set_qty = frappe.format_value(abs(flt(row.get(qty_field))), "Float", row) self.throw_error_message( - f"Total quantity {abs(flt(self.total_qty))} in the Serial and Batch Bundle {bold(self.name)} does not match with the quantity {abs(flt(row.get(qty_field)))} for the Item {bold(self.item_code)} in the {self.voucher_type} # {self.voucher_no}" + f"Total quantity {total_qty} in the Serial and Batch Bundle {bold(self.name)} does not match with the quantity {set_qty} for the Item {bold(self.item_code)} in the {self.voucher_type} # {self.voucher_no}" ) def get_qty_field(self, row, qty_field=None) -> str: