From f9a09f0ac4dd273fee403b8e0483b735afa81b52 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 06:48:58 +0000 Subject: [PATCH] fix: skip incoming rate calc when serial no qty is zero (backport #57427) (#57956) fix: skip incoming rate calc when serial no qty is zero (#57427) (cherry picked from commit a25decfa50a355307ad187201352f7c465d79eba) Co-authored-by: Shllokkk <140623894+Shllokkk@users.noreply.github.com> --- erpnext/stock/serial_batch_bundle.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index dc659cb79ab..967fc8bea3e 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -774,6 +774,9 @@ class SerialNoValuation(DeprecatedSerialNoValuation): return is_rejected(self.sle.voucher_type, self.sle.voucher_detail_no, self.sle.warehouse) def get_incoming_rate(self): + if not self.sle.actual_qty and self.sle.voucher_type == "Stock Reconciliation": + return 0.0 + return abs(flt(self.stock_value_change) / flt(self.sle.actual_qty)) def get_incoming_rate_of_serial_no(self, serial_no):