refactor: Style transaction items for untracked accounts

This commit extends the "Untrack Account" feature by applying a special style to transaction items that belong to an untracked account.

- The transaction item template is modified to apply a "dimmed" style to transactions from untracked accounts.
- The styling follows the precedence: Account (untracked) > Category (muted) > Transaction (hidden).
- The dropdown menu for transaction items now shows "Controlled by account" if the transaction's account is untracked.
This commit is contained in:
google-labs-jules[bot]
2025-08-09 05:47:18 +00:00
parent 9102654eab
commit 7f8261b9cc
9 changed files with 92 additions and 23 deletions

View File

@@ -62,6 +62,11 @@ class Account(SharedObject):
verbose_name=_("Archived"),
help_text=_("Archived accounts don't show up nor count towards your net worth"),
)
untracked_by = models.ManyToManyField(
settings.AUTH_USER_MODEL,
blank=True,
related_name="untracked_accounts",
)
objects = SharedObjectManager()
all_objects = models.Manager() # Unfiltered manager
@@ -75,6 +80,9 @@ class Account(SharedObject):
def __str__(self):
return self.name
def is_untracked_by(self, user):
return self.untracked_by.filter(pk=user.pk).exists()
def clean(self):
super().clean()
if self.exchange_currency == self.currency: