Account validated in general ledger report. Fixed #1912
This commit is contained in:
parent
5220b462fd
commit
5eea6f1b6d
@ -63,6 +63,8 @@ def get_gl_entries(filters):
|
|||||||
def get_conditions(filters):
|
def get_conditions(filters):
|
||||||
conditions = []
|
conditions = []
|
||||||
if filters.get("account"):
|
if filters.get("account"):
|
||||||
|
if not frappe.db.exists("Account", filters["account"]):
|
||||||
|
frappe.throw(_("Account {0} is not valid").format(filters["account"]))
|
||||||
lft, rgt = frappe.db.get_value("Account", filters["account"], ["lft", "rgt"])
|
lft, rgt = frappe.db.get_value("Account", filters["account"], ["lft", "rgt"])
|
||||||
conditions.append("""account in (select name from tabAccount
|
conditions.append("""account in (select name from tabAccount
|
||||||
where lft>=%s and rgt<=%s and docstatus<2)""" % (lft, rgt))
|
where lft>=%s and rgt<=%s and docstatus<2)""" % (lft, rgt))
|
||||||
|
Loading…
Reference in New Issue
Block a user