From 4bf85d1a5a9d8a916e84205e38ad4db7c4ae2275 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 11 Feb 2025 22:51:17 +0530 Subject: [PATCH] fix: add precision in serial_batch_bundle.py --- erpnext/stock/serial_batch_bundle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index 650c66dd408..993d918f8bc 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -1080,6 +1080,7 @@ class SerialBatchCreation: def set_serial_batch_entries(self, doc): incoming_rate = self.get("incoming_rate") + precision = frappe.get_precision("Serial and Batch Entry", "qty") if self.get("serial_nos"): serial_no_wise_batch = frappe._dict({}) if self.has_batch_no: @@ -1109,7 +1110,8 @@ class SerialBatchCreation: "entries", { "batch_no": batch_no, - "qty": batch_qty * (-1 if self.type_of_transaction == "Outward" else 1), + "qty": flt(batch_qty, precision) + * (-1 if self.type_of_transaction == "Outward" else 1), "incoming_rate": incoming_rate, }, )