mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Force recomputation of lots' is_closed flag when splits are added
or removed. Otherwise it's possible to return a false-negative cached response. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7022 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
d77cf0dbc6
commit
7ddf9aa4e8
@ -234,6 +234,9 @@ gnc_lot_add_split (GNCLot *lot, Split *split)
|
||||
split->lot = lot;
|
||||
|
||||
lot->splits = g_list_append (lot->splits, split);
|
||||
|
||||
/* for recomputation of is-closed */
|
||||
lot->is_closed = -1;
|
||||
}
|
||||
|
||||
void
|
||||
@ -244,11 +247,11 @@ gnc_lot_remove_split (GNCLot *lot, Split *split)
|
||||
ENTER ("(lot=%p, split=%p)", lot, split);
|
||||
lot->splits = g_list_remove (lot->splits, split);
|
||||
split->lot = NULL;
|
||||
lot->is_closed = -1; /* force an is-closed computation */
|
||||
|
||||
if (NULL == lot->splits)
|
||||
{
|
||||
lot->account = NULL;
|
||||
lot->is_closed = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user