mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-03 04:11:16 +02:00
fix: check root type only when not none
(cherry picked from commit cd98be6088)
This commit is contained in:
@@ -659,11 +659,12 @@ def set_gl_entries_by_account(
|
|||||||
& (gle.posting_date <= to_date)
|
& (gle.posting_date <= to_date)
|
||||||
& (account.lft >= root_lft)
|
& (account.lft >= root_lft)
|
||||||
& (account.rgt <= root_rgt)
|
& (account.rgt <= root_rgt)
|
||||||
& (account.root_type == root_type)
|
|
||||||
)
|
)
|
||||||
.orderby(gle.account, gle.posting_date)
|
.orderby(gle.account, gle.posting_date)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if root_type:
|
||||||
|
query = query.where(account.root_type == root_type)
|
||||||
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters, d)
|
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters, d)
|
||||||
if additional_conditions:
|
if additional_conditions:
|
||||||
query = query.where(Criterion.all(additional_conditions))
|
query = query.where(Criterion.all(additional_conditions))
|
||||||
|
|||||||
Reference in New Issue
Block a user