mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 18:08:21 +02:00
Use a proxy for special transactions in treasury app for modularity (not a clean way, but without any other solution...)
This commit is contained in:
@ -3,12 +3,12 @@
|
||||
|
||||
from .notes import Alias, Note, NoteClub, NoteSpecial, NoteUser
|
||||
from .transactions import MembershipTransaction, Transaction, \
|
||||
TemplateCategory, TransactionTemplate, RecurrentTransaction
|
||||
TemplateCategory, TransactionTemplate, RecurrentTransaction, SpecialTransaction
|
||||
|
||||
__all__ = [
|
||||
# Notes
|
||||
'Alias', 'Note', 'NoteClub', 'NoteSpecial', 'NoteUser',
|
||||
# Transactions
|
||||
'MembershipTransaction', 'Transaction', 'TemplateCategory', 'TransactionTemplate',
|
||||
'RecurrentTransaction',
|
||||
'RecurrentTransaction', 'SpecialTransaction',
|
||||
]
|
||||
|
@ -6,7 +6,6 @@ from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from polymorphic.models import PolymorphicModel
|
||||
from treasury.models import Remittance
|
||||
|
||||
from .notes import Note, NoteClub, NoteSpecial
|
||||
|
||||
@ -210,13 +209,6 @@ class SpecialTransaction(Transaction):
|
||||
blank=True,
|
||||
)
|
||||
|
||||
remittance = models.ForeignKey(
|
||||
Remittance,
|
||||
on_delete=models.PROTECT,
|
||||
null=True,
|
||||
verbose_name=_("Remittance"),
|
||||
)
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
return _('Credit') if isinstance(self.source, NoteSpecial) else _("Debit")
|
||||
|
Reference in New Issue
Block a user