From 222e86bb13819f9cc472a0957885456dea126133 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Mon, 21 Aug 2017 07:35:16 +0530 Subject: [PATCH] [hotfix] fixed the mysql syntax error issue on stock ledger report (#10442) --- erpnext/stock/report/stock_ledger/stock_ledger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py index ec55cec3fbf..4a8868ade16 100644 --- a/erpnext/stock/report/stock_ledger/stock_ledger.py +++ b/erpnext/stock/report/stock_ledger/stock_ledger.py @@ -73,7 +73,9 @@ def get_sle_conditions(filters): conditions.append("""item_code in (select name from tabItem {item_conditions})""".format(item_conditions=item_conditions)) if filters.get("warehouse"): - conditions.append(get_warehouse_condition(filters.get("warehouse"))) + warehouse_condition = get_warehouse_condition(filters.get("warehouse")) + if warehouse_condition: + conditions.append(warehouse_condition) if filters.get("voucher_no"): conditions.append("voucher_no=%(voucher_no)s") if filters.get("batch_no"):