Commit a035abb3 authored by alexAubin's avatar alexAubin

Fix an issue with bills when manually adding payments

parent 2b799c44
......@@ -142,7 +142,7 @@ class Bill(models.Model):
"Creating draft bill DRAFT-{} (Member: {}).".format(
self.pk, self.member))
else:
if not self.validated:
if hasattr(self, 'validated') and not self.validated:
accounting_log.info(
"Updating draft bill DRAFT-{} (Member: {}).".format(
self.pk, self.member))
......@@ -738,7 +738,7 @@ def reconcile_bills_and_payments(member):
# If this payment is to be allocated for a specific bill...
if p.bill:
# Assert that the invoice is still 'active'
assert p.bill in active_bills
assert p.bill.pk in [b.pk for b in active_bills]
i = p.bill
accounting_log.info(
"Payment is to be allocated specifically to bill {}".format(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment