Fix display error for quote numbers in edit view

This commit is contained in:
Kumi 2021-11-13 17:17:18 +01:00
parent 2feb3e637b
commit 8c42b386f3
2 changed files with 7 additions and 3 deletions

View file

@ -15,6 +15,10 @@ class Quote(Model):
expiry = DateField()
currency = ForeignKey(Currency, on_delete=PROTECT)
@property
def display_number(self):
return self.number or self.id
class QuoteItem(Model):
invoice = ForeignKey(Quote, on_delete=CASCADE)
sort = PositiveIntegerField()

View file

@ -27,7 +27,7 @@
<div class="card-header-tab card-header-tab-animation card-header">
<div class="card-header-title">
<i class="header-icon lnr-apartment icon-gradient bg-love-kiss"> </i>
Editing {{ object.number or object.id }}
Editing {{ object.display_number }}
</div>
</div>
<div class="card-body">