fix: recurring transactions not adding entities or tags to created transactions

This commit is contained in:
Herculino Trotta
2025-12-19 23:55:30 -03:00
parent 94f5c25829
commit edcad37926
+2 -5
View File
@@ -20,7 +20,6 @@ from django.core.validators import MinValueValidator
from django.db import models, transaction from django.db import models, transaction
from django.db.models import Q from django.db.models import Q
from django.dispatch import Signal from django.dispatch import Signal
from django.forms import ValidationError
from django.template.defaultfilters import date from django.template.defaultfilters import date
from django.utils import timezone from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
@@ -871,10 +870,8 @@ class RecurringTransaction(models.Model):
notes=self.notes if self.add_notes_to_transaction else "", notes=self.notes if self.add_notes_to_transaction else "",
owner=self.account.owner, owner=self.account.owner,
) )
if self.tags.exists(): created_transaction.tags.set(self.tags.all())
created_transaction.tags.set(self.tags.all()) created_transaction.entities.set(self.entities.all())
if self.entities.exists():
created_transaction.entities.set(self.entities.all())
def get_recurrence_delta(self): def get_recurrence_delta(self):
if self.recurrence_type == self.RecurrenceType.DAY: if self.recurrence_type == self.RecurrenceType.DAY: