calling root.getAccountByName("a:b:c") correctly returns the account for a:b:c
calling root.getAccountByName("xx:yy:c") correctly returns None as it does not exist
But calling root.getAccountByName("xx:yy:c", Account.AccountType.EXPENSE) incorrectly returns the Account for "a:b:c" (note xx:yy:c does not exist). It seems to somehow just be looking for the last account name in the string, rather than matching all the prior accounts between the ::'s
I am unclear whether it matters which object you call .getAccountByName() on - i.e. does it matter.. My tests indicate not. This is an annoying problem. The only resolution is to call the function without the AccountType and then check the returned account's account type (but of course, doesn't help with duplicate account names.
Using this example category structure:
EXPENSE
a:b:c
calling root.getAccountByName("
a:b:c
") correctly returns the account fora:b:c
calling root.getAccountByName("
xx:yy:c
") correctly returns None as it does not existBut calling root.getAccountByName("
xx:yy:c
", Account.AccountType.EXPENSE) incorrectly returns the Account for "a:b:c
" (notexx:yy:c
does not exist). It seems to somehow just be looking for the last account name in the string, rather than matching all the prior accounts between the::
'sI am unclear whether it matters which object you call .getAccountByName() on - i.e. does it matter.. My tests indicate not. This is an annoying problem. The only resolution is to call the function without the AccountType and then check the returned account's account type (but of course, doesn't help with duplicate account names.