Fix posting of unreconciled StatementLines to ledger
This commit is contained in:
parent
13123deebe
commit
e3900589e6
@ -35,9 +35,9 @@ class StatementLine(db.Model):
|
||||
return Amount(self.quantity, self.commodity)
|
||||
|
||||
def into_transaction(self):
|
||||
if len(self.reconciliations) > 0:
|
||||
if self.reconciliation:
|
||||
# Will already be accounted for in a StatementLineTransaction
|
||||
raise Exception('Should not call into_transaction on a StatementLine with associated StatementLinePosting')
|
||||
raise Exception('Should not call into_transaction on a reconciled StatementLine')
|
||||
|
||||
# Not classified
|
||||
unclassified_name = 'Unclassified Statement Line Debits' if -self.quantity >= 0 else 'Unclassified Statement Line Credits'
|
||||
|
Loading…
Reference in New Issue
Block a user