mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
fix: handle empty warehouse condition in get_warehouse_condition function; typo;
(cherry picked from commit fca9843fc2)
This commit is contained in:
@@ -637,6 +637,9 @@ def get_opening_balance(filters, columns, sl_entries):
|
||||
|
||||
|
||||
def get_warehouse_condition(warehouses):
|
||||
if not warehouses:
|
||||
return ""
|
||||
|
||||
if isinstance(warehouses, str):
|
||||
warehouses = [warehouses]
|
||||
|
||||
@@ -653,14 +656,14 @@ def get_warehouse_condition(warehouses):
|
||||
return ""
|
||||
|
||||
alias = "wh"
|
||||
condtions = []
|
||||
conditions = []
|
||||
for lft, rgt in warehouse_range:
|
||||
condtions.append(f"({alias}.lft >= {lft} and {alias}.rgt <= {rgt})")
|
||||
conditions.append(f"({alias}.lft >= {lft} and {alias}.rgt <= {rgt})")
|
||||
|
||||
condtions = " or ".join(condtions)
|
||||
conditions = " or ".join(conditions)
|
||||
|
||||
return f" exists (select name from `tabWarehouse` {alias} \
|
||||
where ({condtions}) and warehouse = {alias}.name)"
|
||||
where ({conditions}) and warehouse = {alias}.name)"
|
||||
|
||||
|
||||
def get_item_group_condition(item_group, item_table=None):
|
||||
|
||||
Reference in New Issue
Block a user