mthxx / Budget

Personal Finance for the Linux desktop.
http://mthx.org/projects/budget/
GNU General Public License v2.0
10 stars 3 forks source link

Entries from a deleted category don't automatically show up #90

Closed mthxx closed 8 years ago

mthxx commented 8 years ago

If you delete a category that has entries assigned to it, the entries get re-assigned to their appropriate "uncategorized" bucket. However, while these entries are correctly handled in the database, the transactions page does not automatically refresh itself with the appropriate changes. The changes are not reflected until the application is restarted, and all data is refreshed.

mthxx commented 8 years ago

It appears the issue resides somewhere in data.py -> def update_aggregates.

When a category is deleted, all of it's entries are properly updated in the database in the transactions table. Despite the function update_aggregates being run, the totals are in fact not being updated properly. The deleted category remains in the aggregates table with values, and the uncategorized aggregates remain at zero.

Interestingly though, if a second category is deleted, the uncategorized aggregates fields do finally get updated but only with the aggregates of the previous category. It continues to ignore the most recently deleted category. Additionally, the aggregates table retains entries for the deleted category's, which might cause problems when new categories are added and assume the deleted categories ID.

mthxx commented 8 years ago

Nearly complete. Only thing remaining is removing values (and row) of deleted category from the overview tab. Then additional testing to determine if there are any other edge cases needing to be addressed.