From 91af7c033aa3fc69146bd073d6d583e9e5ca50aa Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 15:35:55 +0530 Subject: [PATCH] fix: decimal issue while making the stock entry (backport #40394) (#40397) fix: decimal issue while making the stock entry (#40394) (cherry picked from commit 4a02d1497ce7fa3149a660737f793b157f5ab771) Co-authored-by: rohitwaghchaure --- erpnext/stock/doctype/stock_entry/stock_entry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 5a1d22ecd6d..4421a3e7938 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -2064,6 +2064,7 @@ class StockEntry(StockController): as_dict=1, ) + precision = frappe.get_precision("Stock Entry Detail", "qty") for key, row in available_materials.items(): remaining_qty_to_produce = flt(wo_data.trans_qty) - flt(wo_data.produced_qty) if remaining_qty_to_produce <= 0 and not self.is_return: @@ -2086,7 +2087,8 @@ class StockEntry(StockController): serial_nos = row.serial_nos[0 : cint(qty)] row.serial_nos = serial_nos - self.update_item_in_stock_entry_detail(row, item, qty) + if flt(qty, precision) != 0.0: + self.update_item_in_stock_entry_detail(row, item, qty) def update_batches_to_be_consume(self, batches, row, qty): qty_to_be_consumed = qty