gnucash master: Delete Account: Short circuit checks if no transactions or subaccounts

Robert Fewell bobit at code.gnucash.org
Thu May 28 07:14:56 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/890637b2 (commit)
	from  https://github.com/Gnucash/gnucash/commit/3457dd15 (commit)



commit 890637b2dccd1c56ca51b3bed2a0e7ca706641bf
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu May 28 12:13:14 2020 +0100

    Delete Account: Short circuit checks if no transactions or subaccounts
    
    Count of splits and number of children need to be or'd

diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.c b/gnucash/gnome/gnc-plugin-page-account-tree.c
index e009d85e0..f66406602 100644
--- a/gnucash/gnome/gnc-plugin-page-account-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-account-tree.c
@@ -1605,7 +1605,7 @@ gnc_plugin_page_account_tree_cmd_delete_account (GtkAction *action, GncPluginPag
     }
 
     // If no transaction or children just delete it.
-    if (!(xaccAccountCountSplits (account, FALSE) &&
+    if (!(xaccAccountCountSplits (account, FALSE) ||
           gnc_account_n_children (account)))
     {
         do_delete_account (account, NULL, NULL, NULL);



Summary of changes:
 gnucash/gnome/gnc-plugin-page-account-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list