From af18ea598e1ca860b28a05c31316c0a3fbccd40e Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 11 Mar 2024 10:14:09 +0100 Subject: [PATCH] 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. --- libgnucash/engine/Split.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. */