diff --git a/app/apps/transactions/models.py b/app/apps/transactions/models.py index be85547..8399e3a 100644 --- a/app/apps/transactions/models.py +++ b/app/apps/transactions/models.py @@ -937,8 +937,10 @@ class RecurringTransaction(models.Model): notes=self.notes if self.add_notes_to_transaction else "", owner=self.account.owner, ) - created_transaction.tags.set(self.tags.all()) - created_transaction.entities.set(self.entities.all()) + # Unfiltered managers: generation also runs without a current user, or with a + # different one, and the scoped default manager would hide private rows. + created_transaction.tags.set(self.tags(manager="all_objects").all()) + created_transaction.entities.set(self.entities(manager="all_objects").all()) def get_recurrence_delta(self): if self.recurrence_type == self.RecurrenceType.DAY: @@ -1030,9 +1032,11 @@ class RecurringTransaction(models.Model): self.notes if self.add_notes_to_transaction else "" ) - # Update many-to-many relationships - existing_transaction.tags.set(self.tags.all()) - existing_transaction.entities.set(self.entities.all()) + # Update many-to-many relationships (see create_transaction) + existing_transaction.tags.set(self.tags(manager="all_objects").all()) + existing_transaction.entities.set( + self.entities(manager="all_objects").all() + ) # Save updated transaction existing_transaction.save() diff --git a/app/apps/transactions/tests/test_models.py b/app/apps/transactions/tests/test_models.py index 546d6b3..72e4340 100644 --- a/app/apps/transactions/tests/test_models.py +++ b/app/apps/transactions/tests/test_models.py @@ -7,6 +7,7 @@ from django.utils import timezone from apps.transactions.models import ( TransactionCategory, TransactionTag, + TransactionEntity, Transaction, InstallmentPlan, RecurringTransaction, @@ -240,3 +241,27 @@ class RecurringTransactionTests(TestCase): self.assertFalse(recurring.is_paused) self.assertEqual(recurring.recurrence_interval, 1) self.assertEqual(recurring.account.currency.code, "USD") + + def test_generate_upcoming_transactions_keeps_tags_and_entities(self): + """Generation must copy tags/entities even with no current user""" + tag = TransactionTag.objects.create(name="Essential") + entity = TransactionEntity.objects.create(name="Landlord") + recurring = RecurringTransaction.objects.create( + account=self.account, + type=Transaction.Type.EXPENSE, + amount=Decimal("100.00"), + description="Monthly Payment", + start_date=timezone.now().date(), + recurrence_type=RecurringTransaction.RecurrenceType.MONTH, + recurrence_interval=1, + ) + recurring.tags.set([tag]) + recurring.entities.set([entity]) + + RecurringTransaction.generate_upcoming_transactions() + + generated = Transaction.all_objects.filter(recurring_transaction=recurring) + self.assertTrue(generated.exists()) + for transaction in generated: + self.assertIn(tag, transaction.tags(manager="all_objects").all()) + self.assertIn(entity, transaction.entities(manager="all_objects").all()) diff --git a/app/locale/de/LC_MESSAGES/django.po b/app/locale/de/LC_MESSAGES/django.po index 2c04cfb..989dc0f 100644 --- a/app/locale/de/LC_MESSAGES/django.po +++ b/app/locale/de/LC_MESSAGES/django.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-07-18 18:43+0000\n" -"PO-Revision-Date: 2026-04-09 11:24+0000\n" -"Last-Translator: LordTimothyHKIT \n" +"POT-Creation-Date: 2026-08-13 03:01+0000\n" +"PO-Revision-Date: 2026-08-10 12:57+0000\n" +"Last-Translator: GitEbu \n" "Language-Team: German \n" "Language: de\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.16.2\n" +"X-Generator: Weblate 2026.8\n" #: apps/accounts/forms.py:24 msgid "Group name" @@ -68,7 +68,7 @@ msgstr "Neuer Saldo" #: apps/transactions/forms.py:579 apps/transactions/forms.py:763 #: apps/transactions/forms.py:1007 apps/transactions/models.py:331 #: apps/transactions/models.py:641 apps/transactions/models.py:841 -#: apps/transactions/models.py:1089 +#: apps/transactions/models.py:1093 #: templates/insights/fragments/category_overview/index.html:86 #: templates/insights/fragments/category_overview/index.html:542 #: templates/insights/fragments/month_by_month.html:84 @@ -85,7 +85,7 @@ msgstr "Kategorie" #: apps/transactions/forms.py:596 apps/transactions/forms.py:756 #: apps/transactions/forms.py:1000 apps/transactions/models.py:337 #: apps/transactions/models.py:643 apps/transactions/models.py:845 -#: apps/transactions/models.py:1095 templates/includes/sidebar.html:150 +#: apps/transactions/models.py:1099 templates/includes/sidebar.html:150 #: templates/insights/fragments/category_overview/index.html:40 #: templates/insights/fragments/month_by_month.html:29 #: templates/insights/fragments/month_by_month.html:32 @@ -98,7 +98,7 @@ msgstr "Tags" #: apps/accounts/models.py:12 apps/accounts/models.py:29 apps/dca/models.py:13 #: apps/import_app/models.py:14 apps/rules/models.py:13 #: apps/transactions/models.py:223 apps/transactions/models.py:248 -#: apps/transactions/models.py:272 apps/transactions/models.py:1057 +#: apps/transactions/models.py:272 apps/transactions/models.py:1061 #: apps/users/models.py:572 templates/account_groups/fragments/list.html:22 #: templates/accounts/fragments/list.html:22 #: templates/categories/fragments/table.html:17 @@ -171,7 +171,7 @@ msgstr "" #: apps/transactions/forms.py:442 apps/transactions/forms.py:748 #: apps/transactions/forms.py:992 apps/transactions/models.py:303 #: apps/transactions/models.py:601 apps/transactions/models.py:823 -#: apps/transactions/models.py:1063 +#: apps/transactions/models.py:1067 #: templates/installment_plans/fragments/table.html:17 #: templates/quick_transactions/fragments/list.html:14 #: templates/recurring_transactions/fragments/table.html:19 @@ -641,6 +641,8 @@ msgstr "Umrechnungskurs bearbeiten" #: apps/currencies/models.py:166 msgid "Create one exchange rate and keep updating it. Avoids database clutter." msgstr "" +"Legen Sie einen Wechselkurs an und aktualisieren Sie ihn regelmäßig. So " +"vermeiden Sie Unübersichtlichkeit in der Datenbank." #: apps/currencies/models.py:171 msgid "Exchange Rate Service" @@ -770,7 +772,7 @@ msgstr "Startwährung" #: apps/rules/forms.py:196 apps/rules/models.py:43 apps/rules/models.py:295 #: apps/transactions/forms.py:469 apps/transactions/forms.py:616 #: apps/transactions/models.py:327 apps/transactions/models.py:650 -#: apps/transactions/models.py:851 apps/transactions/models.py:1085 +#: apps/transactions/models.py:851 apps/transactions/models.py:1089 msgid "Notes" msgstr "Notizen" @@ -858,7 +860,7 @@ msgstr "Kategorien" #: apps/transactions/forms.py:491 apps/transactions/forms.py:771 #: apps/transactions/forms.py:1015 apps/transactions/models.py:286 #: apps/transactions/models.py:342 apps/transactions/models.py:646 -#: apps/transactions/models.py:848 apps/transactions/models.py:1100 +#: apps/transactions/models.py:848 apps/transactions/models.py:1104 #: templates/entities/fragments/list.html:9 #: templates/entities/pages/index.html:4 templates/includes/sidebar.html:156 #: templates/insights/fragments/category_overview/index.html:54 @@ -1130,14 +1132,14 @@ msgstr "Bediener" #: apps/rules/forms.py:174 apps/rules/forms.py:188 apps/rules/models.py:36 #: apps/rules/models.py:271 apps/transactions/forms.py:433 #: apps/transactions/models.py:310 apps/transactions/models.py:606 -#: apps/transactions/models.py:829 apps/transactions/models.py:1070 +#: apps/transactions/models.py:829 apps/transactions/models.py:1074 msgid "Type" msgstr "Typ" #: apps/rules/forms.py:175 apps/rules/forms.py:189 apps/rules/models.py:37 #: apps/rules/models.py:275 apps/transactions/filters.py:22 #: apps/transactions/forms.py:437 apps/transactions/models.py:312 -#: apps/transactions/models.py:1072 templates/cotton/transaction/item.html:20 +#: apps/transactions/models.py:1076 templates/cotton/transaction/item.html:20 #: templates/cotton/transaction/item.html:31 #: templates/transactions/widgets/paid_toggle_button.html:10 #: templates/transactions/widgets/unselectable_paid_toggle_button.html:13 @@ -1155,7 +1157,7 @@ msgstr "Referenzdatum" #: apps/rules/forms.py:178 apps/rules/forms.py:192 apps/rules/models.py:41 #: apps/rules/models.py:287 apps/transactions/forms.py:460 #: apps/transactions/models.py:320 apps/transactions/models.py:834 -#: apps/transactions/models.py:1078 +#: apps/transactions/models.py:1082 #: templates/insights/fragments/sankey.html:102 #: templates/installment_plans/fragments/table.html:18 #: templates/quick_transactions/fragments/list.html:15 @@ -1167,26 +1169,26 @@ msgstr "Betrag" #: apps/rules/models.py:42 apps/rules/models.py:291 #: apps/transactions/forms.py:464 apps/transactions/forms.py:607 #: apps/transactions/models.py:325 apps/transactions/models.py:608 -#: apps/transactions/models.py:837 apps/transactions/models.py:1083 +#: apps/transactions/models.py:837 apps/transactions/models.py:1087 msgid "Description" msgstr "Beschreibung" #: apps/rules/forms.py:182 apps/rules/forms.py:198 apps/rules/models.py:47 #: apps/rules/models.py:299 apps/transactions/models.py:364 -#: apps/transactions/models.py:1105 +#: apps/transactions/models.py:1109 msgid "Internal Note" msgstr "Interne Notiz" #: apps/rules/forms.py:183 apps/rules/forms.py:199 apps/rules/models.py:48 #: apps/rules/models.py:303 apps/transactions/models.py:366 -#: apps/transactions/models.py:1107 +#: apps/transactions/models.py:1111 msgid "Internal ID" msgstr "Interne ID" #: apps/rules/forms.py:186 apps/rules/forms.py:200 apps/rules/models.py:40 #: apps/rules/models.py:319 apps/transactions/forms.py:620 #: apps/transactions/models.py:224 apps/transactions/models.py:315 -#: apps/transactions/models.py:1073 +#: apps/transactions/models.py:1077 msgid "Mute" msgstr "Stummschalten" @@ -1529,7 +1531,7 @@ msgstr "" msgid "Entity" msgstr "Entität" -#: apps/transactions/models.py:297 apps/transactions/models.py:1050 +#: apps/transactions/models.py:297 apps/transactions/models.py:1054 #: templates/calendar_view/fragments/list.html:42 #: templates/calendar_view/fragments/list.html:44 #: templates/calendar_view/fragments/list.html:52 @@ -1541,7 +1543,7 @@ msgstr "Entität" msgid "Income" msgstr "Einnahme" -#: apps/transactions/models.py:298 apps/transactions/models.py:1051 +#: apps/transactions/models.py:298 apps/transactions/models.py:1055 #: templates/calendar_view/fragments/list.html:46 #: templates/calendar_view/fragments/list.html:48 #: templates/calendar_view/fragments/list.html:56 @@ -1711,7 +1713,7 @@ msgstr "Letztes generiertes Datum" msgid "Last Generated Reference Date" msgstr "Letztes generiertes Referenzdatum" -#: apps/transactions/models.py:1117 +#: apps/transactions/models.py:1121 #: apps/transactions/views/quick_transactions.py:178 #: apps/transactions/views/quick_transactions.py:187 #: apps/transactions/views/quick_transactions.py:189 @@ -1720,7 +1722,7 @@ msgstr "Letztes generiertes Referenzdatum" msgid "Quick Transaction" msgstr "Schnelle Transaktion" -#: apps/transactions/models.py:1118 templates/includes/sidebar.html:98 +#: apps/transactions/models.py:1122 templates/includes/sidebar.html:98 #: templates/quick_transactions/pages/index.html:5 #: templates/quick_transactions/pages/index.html:15 msgid "Quick Transactions" diff --git a/app/locale/en/LC_MESSAGES/django.po b/app/locale/en/LC_MESSAGES/django.po index 08af233..f31deac 100644 --- a/app/locale/en/LC_MESSAGES/django.po +++ b/app/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-07-18 18:43+0000\n" +"POT-Creation-Date: 2026-08-13 03:01+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -67,7 +67,7 @@ msgstr "" #: apps/transactions/forms.py:579 apps/transactions/forms.py:763 #: apps/transactions/forms.py:1007 apps/transactions/models.py:331 #: apps/transactions/models.py:641 apps/transactions/models.py:841 -#: apps/transactions/models.py:1089 +#: apps/transactions/models.py:1093 #: templates/insights/fragments/category_overview/index.html:86 #: templates/insights/fragments/category_overview/index.html:542 #: templates/insights/fragments/month_by_month.html:84 @@ -84,7 +84,7 @@ msgstr "" #: apps/transactions/forms.py:596 apps/transactions/forms.py:756 #: apps/transactions/forms.py:1000 apps/transactions/models.py:337 #: apps/transactions/models.py:643 apps/transactions/models.py:845 -#: apps/transactions/models.py:1095 templates/includes/sidebar.html:150 +#: apps/transactions/models.py:1099 templates/includes/sidebar.html:150 #: templates/insights/fragments/category_overview/index.html:40 #: templates/insights/fragments/month_by_month.html:29 #: templates/insights/fragments/month_by_month.html:32 @@ -97,7 +97,7 @@ msgstr "" #: apps/accounts/models.py:12 apps/accounts/models.py:29 apps/dca/models.py:13 #: apps/import_app/models.py:14 apps/rules/models.py:13 #: apps/transactions/models.py:223 apps/transactions/models.py:248 -#: apps/transactions/models.py:272 apps/transactions/models.py:1057 +#: apps/transactions/models.py:272 apps/transactions/models.py:1061 #: apps/users/models.py:572 templates/account_groups/fragments/list.html:22 #: templates/accounts/fragments/list.html:22 #: templates/categories/fragments/table.html:17 @@ -167,7 +167,7 @@ msgstr "" #: apps/transactions/forms.py:442 apps/transactions/forms.py:748 #: apps/transactions/forms.py:992 apps/transactions/models.py:303 #: apps/transactions/models.py:601 apps/transactions/models.py:823 -#: apps/transactions/models.py:1063 +#: apps/transactions/models.py:1067 #: templates/installment_plans/fragments/table.html:17 #: templates/quick_transactions/fragments/list.html:14 #: templates/recurring_transactions/fragments/table.html:19 @@ -748,7 +748,7 @@ msgstr "" #: apps/rules/forms.py:196 apps/rules/models.py:43 apps/rules/models.py:295 #: apps/transactions/forms.py:469 apps/transactions/forms.py:616 #: apps/transactions/models.py:327 apps/transactions/models.py:650 -#: apps/transactions/models.py:851 apps/transactions/models.py:1085 +#: apps/transactions/models.py:851 apps/transactions/models.py:1089 msgid "Notes" msgstr "" @@ -836,7 +836,7 @@ msgstr "" #: apps/transactions/forms.py:491 apps/transactions/forms.py:771 #: apps/transactions/forms.py:1015 apps/transactions/models.py:286 #: apps/transactions/models.py:342 apps/transactions/models.py:646 -#: apps/transactions/models.py:848 apps/transactions/models.py:1100 +#: apps/transactions/models.py:848 apps/transactions/models.py:1104 #: templates/entities/fragments/list.html:9 #: templates/entities/pages/index.html:4 templates/includes/sidebar.html:156 #: templates/insights/fragments/category_overview/index.html:54 @@ -1106,14 +1106,14 @@ msgstr "" #: apps/rules/forms.py:174 apps/rules/forms.py:188 apps/rules/models.py:36 #: apps/rules/models.py:271 apps/transactions/forms.py:433 #: apps/transactions/models.py:310 apps/transactions/models.py:606 -#: apps/transactions/models.py:829 apps/transactions/models.py:1070 +#: apps/transactions/models.py:829 apps/transactions/models.py:1074 msgid "Type" msgstr "" #: apps/rules/forms.py:175 apps/rules/forms.py:189 apps/rules/models.py:37 #: apps/rules/models.py:275 apps/transactions/filters.py:22 #: apps/transactions/forms.py:437 apps/transactions/models.py:312 -#: apps/transactions/models.py:1072 templates/cotton/transaction/item.html:20 +#: apps/transactions/models.py:1076 templates/cotton/transaction/item.html:20 #: templates/cotton/transaction/item.html:31 #: templates/transactions/widgets/paid_toggle_button.html:10 #: templates/transactions/widgets/unselectable_paid_toggle_button.html:13 @@ -1131,7 +1131,7 @@ msgstr "" #: apps/rules/forms.py:178 apps/rules/forms.py:192 apps/rules/models.py:41 #: apps/rules/models.py:287 apps/transactions/forms.py:460 #: apps/transactions/models.py:320 apps/transactions/models.py:834 -#: apps/transactions/models.py:1078 +#: apps/transactions/models.py:1082 #: templates/insights/fragments/sankey.html:102 #: templates/installment_plans/fragments/table.html:18 #: templates/quick_transactions/fragments/list.html:15 @@ -1143,26 +1143,26 @@ msgstr "" #: apps/rules/models.py:42 apps/rules/models.py:291 #: apps/transactions/forms.py:464 apps/transactions/forms.py:607 #: apps/transactions/models.py:325 apps/transactions/models.py:608 -#: apps/transactions/models.py:837 apps/transactions/models.py:1083 +#: apps/transactions/models.py:837 apps/transactions/models.py:1087 msgid "Description" msgstr "" #: apps/rules/forms.py:182 apps/rules/forms.py:198 apps/rules/models.py:47 #: apps/rules/models.py:299 apps/transactions/models.py:364 -#: apps/transactions/models.py:1105 +#: apps/transactions/models.py:1109 msgid "Internal Note" msgstr "" #: apps/rules/forms.py:183 apps/rules/forms.py:199 apps/rules/models.py:48 #: apps/rules/models.py:303 apps/transactions/models.py:366 -#: apps/transactions/models.py:1107 +#: apps/transactions/models.py:1111 msgid "Internal ID" msgstr "" #: apps/rules/forms.py:186 apps/rules/forms.py:200 apps/rules/models.py:40 #: apps/rules/models.py:319 apps/transactions/forms.py:620 #: apps/transactions/models.py:224 apps/transactions/models.py:315 -#: apps/transactions/models.py:1073 +#: apps/transactions/models.py:1077 msgid "Mute" msgstr "" @@ -1483,7 +1483,7 @@ msgstr "" msgid "Entity" msgstr "" -#: apps/transactions/models.py:297 apps/transactions/models.py:1050 +#: apps/transactions/models.py:297 apps/transactions/models.py:1054 #: templates/calendar_view/fragments/list.html:42 #: templates/calendar_view/fragments/list.html:44 #: templates/calendar_view/fragments/list.html:52 @@ -1495,7 +1495,7 @@ msgstr "" msgid "Income" msgstr "" -#: apps/transactions/models.py:298 apps/transactions/models.py:1051 +#: apps/transactions/models.py:298 apps/transactions/models.py:1055 #: templates/calendar_view/fragments/list.html:46 #: templates/calendar_view/fragments/list.html:48 #: templates/calendar_view/fragments/list.html:56 @@ -1656,7 +1656,7 @@ msgstr "" msgid "Last Generated Reference Date" msgstr "" -#: apps/transactions/models.py:1117 +#: apps/transactions/models.py:1121 #: apps/transactions/views/quick_transactions.py:178 #: apps/transactions/views/quick_transactions.py:187 #: apps/transactions/views/quick_transactions.py:189 @@ -1665,7 +1665,7 @@ msgstr "" msgid "Quick Transaction" msgstr "" -#: apps/transactions/models.py:1118 templates/includes/sidebar.html:98 +#: apps/transactions/models.py:1122 templates/includes/sidebar.html:98 #: templates/quick_transactions/pages/index.html:5 #: templates/quick_transactions/pages/index.html:15 msgid "Quick Transactions" diff --git a/app/locale/es/LC_MESSAGES/django.po b/app/locale/es/LC_MESSAGES/django.po index 7f08f96..7c292b3 100644 --- a/app/locale/es/LC_MESSAGES/django.po +++ b/app/locale/es/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-07-18 18:43+0000\n" +"POT-Creation-Date: 2026-08-13 03:01+0000\n" "PO-Revision-Date: 2026-07-10 04:57+0000\n" "Last-Translator: Juan David Afanador \n" "Language-Team: Spanish \n" "Language-Team: French \n" "Language-Team: Hungarian \n" "Language-Team: Italian \n" "Language-Team: Dutch \n" "Language-Team: Polish \n" "Language-Team: Portuguese (Brazil) \n" "Language-Team: Russian \n" "Language-Team: Swedish \n" "Language-Team: Swahili \n" "Language-Team: Ukrainian \n" "Language-Team: Chinese (Traditional Han script)