Merge pull request #15282 from rohitwaghchaure/budget_should_check_on_submit_document

[Minor] Don't validate on cancelled budgets
This commit is contained in:
rohitwaghchaure 2018-08-31 16:59:56 +05:30 committed by GitHub
commit 5f79479bd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)