mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-18 09:47:14 +00:00
Fix: Logic bug (#19692)
account_groups = [accounts[d]["account_type"] for d in accounts if accounts[d]['is_group'] not in ('', 1)]
- if accounts[d]['is_group'] not in ('', 1) is wrong because it returns false even if the account is a group.
- should be if accounts[d]['is_group'] not in ('', 0)
However, the correction provided here:
account_groups = [accounts[d]["account_type"] for d in accounts if accounts[d]['is_group'] == 1]
is more consistent with the prior statement that extracts ledger (and not group) accounts.
account_types = [accounts[d]["account_type"] for d in accounts if not accounts[d]['is_group'] == 1]
This commit is contained in:
committed by
Nabin Hait
parent
9f3276046f
commit
5c2ba0ef9c
@@ -185,7 +185,8 @@ def validate_account_types(accounts):
|
||||
return _("Please identify/create Account (Ledger) for type - {0}").format(' , '.join(missing))
|
||||
|
||||
account_types_for_group = ["Bank", "Cash", "Stock"]
|
||||
account_groups = [accounts[d]["account_type"] for d in accounts if accounts[d]['is_group'] not in ('', 1)]
|
||||
# fix logic bug
|
||||
account_groups = [accounts[d]["account_type"] for d in accounts if accounts[d]['is_group'] == 1]
|
||||
|
||||
missing = list(set(account_types_for_group) - set(account_groups))
|
||||
if missing:
|
||||
|
||||
Reference in New Issue
Block a user