From 49952355e609c8fbfc3fd83949f22567ccc663ef Mon Sep 17 00:00:00 2001 From: Benjamin Graillot Date: Sat, 14 Mar 2020 13:16:18 +0100 Subject: [PATCH] [note] Added type property to transactions --- apps/note/models/transactions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/note/models/transactions.py b/apps/note/models/transactions.py index ed8619d6..7ea2d367 100644 --- a/apps/note/models/transactions.py +++ b/apps/note/models/transactions.py @@ -157,6 +157,10 @@ class Transaction(PolymorphicModel): def total(self): return self.amount * self.quantity + @property + def type(self): + return _('transfert') + class TemplateTransaction(Transaction): """ @@ -174,6 +178,10 @@ class TemplateTransaction(Transaction): on_delete=models.PROTECT, ) + @property + def type(self): + return _('template') + class MembershipTransaction(Transaction): """ @@ -190,3 +198,7 @@ class MembershipTransaction(Transaction): class Meta: verbose_name = _("membership transaction") verbose_name_plural = _("membership transactions") + + @property + def type(self): + return _('membership')