mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-13 20:05:09 +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):
|
def get_warehouse_condition(warehouses):
|
||||||
|
if not warehouses:
|
||||||
|
return ""
|
||||||
|
|
||||||
if isinstance(warehouses, str):
|
if isinstance(warehouses, str):
|
||||||
warehouses = [warehouses]
|
warehouses = [warehouses]
|
||||||
|
|
||||||
@@ -653,14 +656,14 @@ def get_warehouse_condition(warehouses):
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
alias = "wh"
|
alias = "wh"
|
||||||
condtions = []
|
conditions = []
|
||||||
for lft, rgt in warehouse_range:
|
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} \
|
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):
|
def get_item_group_condition(item_group, item_table=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user