-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: ignore disabled account while selecting Income Accounts #37860
refactor: ignore disabled account while selecting Income Accounts #37860
Conversation
@@ -568,7 +568,7 @@ cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) { | |||
cur_frm.set_query("income_account", "items", function(doc) { | |||
return{ | |||
query: "erpnext.controllers.queries.get_income_account", | |||
filters: {'company': doc.company} | |||
filters: {'company': doc.company, "disabled": 0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you are doing this, maybe remove usage of cur_frm and do the standard way using frm triggers?
Interesting. While the right one, Expense Account, automatically discards disabled accounts, the left one doesn‘t. Would have to investigate why, but adding it manually should normally be superfluous. Also, the right one at least filters for Profit and Loss accounts. Neither one is configured to properly filter for only the relevant Account Type – Income Account and Expense Account, respectively. |
@bosue In this case, |
@ruthra-kumar: Thanks and sorry, I was a bit tired… |
e01bd9b
to
3f668db
Compare
Codecov Report
@@ Coverage Diff @@
## develop #37860 +/- ##
===========================================
- Coverage 67.41% 67.40% -0.02%
===========================================
Files 757 757
Lines 60327 60337 +10
===========================================
Hits 40668 40668
- Misses 19659 19669 +10
|
3f668db
to
6e3e094
Compare
Can't avoid Custom query in this case. Check: https://github.com/frappe/erpnext/blob/9a171db97f67f88fad1589016afb4e808571d04c/erpnext/controllers/queries.py#L603C23-L605 |
…-37860 refactor: ignore disabled account while selecting Income Accounts (backport #37860)
…-37860 refactor: ignore disabled account while selecting Income Accounts (backport #37860)
@mergify backport version-14 |
✅ Backports have been created
|
refactor: ignore disabled account while selecting Income Accounts (backport #37860)
Filter disabled accounts while selecting
Income Account
.