diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 5a76b00ecea..3c1801e1263 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -1108,6 +1108,7 @@ class StockEntry(StockController): precision = frappe.get_precision("Stock Entry Detail", "transfer_qty") tolerance = _qty_tolerance(precision) + qty_tolerance = _qty_tolerance(frappe.get_precision("Stock Entry Detail", "qty")) self.validate_no_missing_components(expected_rows, precision, tolerance) for row in self.items: @@ -1127,7 +1128,9 @@ class StockEntry(StockController): title=_("Invalid Disassembly Item"), ) - if abs(flt(row.transfer_qty, precision) - flt(expected, precision)) > tolerance: + # qty is rounded in the row UOM, so allow that rounding scaled to stock UOM + row_tolerance = max(tolerance, qty_tolerance * flt(row.conversion_factor)) + if abs(flt(row.transfer_qty, precision) - flt(expected, precision)) > row_tolerance: frappe.throw( _( "Row #{0}: Item {1} quantity ({2} in stock UOM) does not match the quantity "