Skip to content

Commit

Permalink
Fixed: cyclic account hierarchies created by accounts setting parent …
Browse files Browse the repository at this point in the history
…to self
  • Loading branch information
codinguser committed Feb 11, 2015
1 parent 0fdb76c commit 8fd7813
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,9 @@ private void loadParentAccountList(AccountType accountType){

if (mAccount != null){ //if editing an account
mDescendantAccountUIDs = mAccountsDbAdapter.getDescendantAccountUIDs(mAccount.getUID(), null, null);
mDescendantAccountUIDs.add(mAccountsDbAdapter.getGnuCashRootAccountUID());
// limit cyclic account hierarchies.
condition += " AND (" + DatabaseSchema.AccountEntry.COLUMN_PARENT_ACCOUNT_UID + " IS NULL "
+ " OR " + DatabaseSchema.AccountEntry.COLUMN_UID + " NOT IN ( '"
condition += " AND (" + DatabaseSchema.AccountEntry.COLUMN_UID + " NOT IN ( '"
+ TextUtils.join("','", mDescendantAccountUIDs) + "','" + mAccountUID + "' ) )";
}

Expand Down

0 comments on commit 8fd7813

Please sign in to comment.