fix: group node in warehouse filter in Item-wise Sales Register
(cherry picked from commit 44538bd02aa150844135d21934bf403ff5244e68)
This commit is contained in:
parent
a2a5b34099
commit
74819b8e70
@ -350,6 +350,12 @@ def get_conditions(filters, additional_conditions=None):
|
||||
and ifnull(`tabSales Invoice Payment`.mode_of_payment, '') = %(mode_of_payment)s)"""
|
||||
|
||||
if filters.get("warehouse"):
|
||||
if frappe.db.get_value("Warehouse", filters.get("warehouse"), "is_group"):
|
||||
lft, rgt = frappe.db.get_all(
|
||||
"Warehouse", filters={"name": filters.get("warehouse")}, fields=["lft", "rgt"], as_list=True
|
||||
)[0]
|
||||
conditions += f"and ifnull(`tabSales Invoice Item`.warehouse, '') in (select name from `tabWarehouse` where lft > {lft} and rgt < {rgt}) "
|
||||
else:
|
||||
conditions += """and ifnull(`tabSales Invoice Item`.warehouse, '') = %(warehouse)s"""
|
||||
|
||||
if filters.get("brand"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user