gnucash stable: Bug 799093 - Cannot reconcile since v5.4

John Ralls jralls at code.gnucash.org
Mon Mar 11 05:23:38 EDT 2024


Updated	 via  https://github.com/Gnucash/gnucash/commit/af18ea59 (commit)
	from  https://github.com/Gnucash/gnucash/commit/97953b6d (commit)



commit af18ea598e1ca860b28a05c31316c0a3fbccd40e
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Mar 11 10:14:09 2024 +0100

    Bug 799093 - Cannot reconcile since v5.4
    
    Covers the final case where having the reconcile window open and
    auto-completing a transaction then deleting the transaction before
    committing it leaves the transaction in the reconcile window.
    
    We need to signal that the account is modified even if it isn't
    because that's what the reconcile window is watching.

diff --git a/libgnucash/engine/Split.cpp b/libgnucash/engine/Split.cpp
index 656adb43a3..88b4101da2 100644
--- a/libgnucash/engine/Split.cpp
+++ b/libgnucash/engine/Split.cpp
@@ -720,7 +720,17 @@ xaccFreeSplit (Split *split)
             gnc_lot_remove_split (split->lot, split);
         if (GNC_IS_ACCOUNT (split->acc)
             && !qof_instance_get_destroying (QOF_INSTANCE (split->acc)))
+        {
             gnc_account_remove_split (split->acc, split);
+            /* gnc_float_split_to_split generates a qof_event_gen via
+             * xaccAccountCommitEdit even though it doesn't touch the
+             * account. That causes QofQueryViews to notice the split
+             * even though it isn't added to the account. We need a
+             * countervailing event so that they'll notice it's not
+             * there any more.
+             */
+            qof_event_gen(&split->acc->inst, QOF_EVENT_MODIFY, nullptr);
+        }
         /* We should do the same for split->parent but we might be getting
          * called from xaccFreeTransaction and that would cause trouble.
          */



Summary of changes:
 libgnucash/engine/Split.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)



More information about the gnucash-changes mailing list