diff --git a/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.py b/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.py index a7963726ae..295d979b83 100644 --- a/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.py +++ b/erpnext/stock/doctype/closing_stock_balance/closing_stock_balance.py @@ -51,7 +51,7 @@ class ClosingStockBalance(Document): for fieldname in ["warehouse", "item_code", "item_group", "warehouse_type"]: if self.get(fieldname): - query = query.where(table.get(fieldname) == self.get(fieldname)) + query = query.where(table[fieldname] == self.get(fieldname)) query = query.run(as_dict=True)