diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 9cbce196e94..ffdb97ef9a6 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -2480,7 +2480,9 @@ def get_stock_value_difference( ) if voucher_detail_no: - query = query.where(table.voucher_detail_no != voucher_detail_no) + query = query.where( + (table.voucher_detail_no != voucher_detail_no) | (table.voucher_detail_no.isnull()) + ) elif voucher_no: query = query.where(table.voucher_no != voucher_no)