From 2b6584a2967e8e14d101f8853fa248b870cd05a6 Mon Sep 17 00:00:00 2001 From: Zarrar Date: Wed, 12 Sep 2018 11:14:24 +0530 Subject: [PATCH] accounts table should be mandatory in budget (#15386) --- erpnext/accounts/doctype/budget/budget.json | 9 +++++---- erpnext/accounts/doctype/budget/budget.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/budget/budget.json b/erpnext/accounts/doctype/budget/budget.json index ef8db86577..a803b65583 100644 --- a/erpnext/accounts/doctype/budget/budget.json +++ b/erpnext/accounts/doctype/budget/budget.json @@ -735,7 +735,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "translatable": 0, @@ -752,7 +752,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-06-15 17:09:01.430292", + "modified": "2018-09-12 11:02:41.825923", "modified_by": "Administrator", "module": "Accounts", "name": "Budget", @@ -785,6 +785,7 @@ "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", - "track_changes": 0, - "track_seen": 0 + "track_changes": 1, + "track_seen": 0, + "track_views": 0 } \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index b02126ff23..c83249b90c 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -36,7 +36,7 @@ class Budget(Document): b.name, ba.account from `tabBudget` b, `tabBudget Account` ba where 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) """ + b.fiscal_year=%s and b.name != %s and 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)