fix: Get only specified company accounts in financial statements (#20486)

This commit is contained in:
Deepesh Garg 2020-02-03 15:49:24 +05:30 committed by GitHub
parent 5e6ce88c78
commit 589f2cd16c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -348,7 +348,8 @@ def set_gl_entries_by_account(
additional_conditions = get_additional_conditions(from_date, ignore_closing_entries, filters)
accounts = frappe.db.sql_list("""select name from `tabAccount`
where lft >= %s and rgt <= %s""", (root_lft, root_rgt))
where lft >= %s and rgt <= %s and company = %s""", (root_lft, root_rgt, company))
additional_conditions += " and account in ({})"\
.format(", ".join([frappe.db.escape(d) for d in accounts]))