Changed the decorated @property balance to a real property in the Record data model in the accounting application, for simplicity.

This commit is contained in:
依瑪貓 2020-08-02 18:00:06 +08:00
parent f3e2280041
commit 377b25f669

View File

@ -276,7 +276,7 @@ class Record(DirtyFieldsMixin, models.Model):
super(Record, self).__init__(*args, **kwargs)
self._debit_amount = None
self._credit_amount = None
self._balance = None
self.balance = None
self._is_balanced = None
self._has_order_hole = None
self._is_credit_card_paid = None
@ -316,14 +316,6 @@ class Record(DirtyFieldsMixin, models.Model):
def credit_amount(self, value):
self._credit_amount = value
@property
def balance(self):
return self._balance
@balance.setter
def balance(self, value):
self._balance = value
@property
def is_balanced(self):
"""Whether the transaction of this record is balanced. """