From 12b4096e687866c1d48513bcd359034f63bf8bbd Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 31 Aug 2018 16:54:59 +0530 Subject: [PATCH] [Minor] Don't validate on cancelled budgest --- erpnext/accounts/doctype/budget/budget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index d025583b51..da3f142f5b 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -33,7 +33,7 @@ class Budget(Document): select b.name, ba.account from `tabBudget` b, `tabBudget Account` ba where - ba.parent = b.name and b.company = %s and %s=%s and + ba.parent = b.name and b.docstatus < 2 and b.company = %s and %s=%s and b.fiscal_year=%s and b.name != %sand ba.account in (%s) """ % ('%s', budget_against_field, '%s', '%s', '%s', ','.join(['%s'] * len(accounts))), (self.company, budget_against, self.fiscal_year, self.name) + tuple(accounts), as_dict=1)