improve counter dump admin

This commit is contained in:
imperosol committed 2024-11-19 00:43:17 +01:00
1 parent 9991f5dc64
commit e712f9fdb8
2 files changed
+19 -1

No files matched your search

+8
View File
@@ -279,6 +279,14 @@ class AccountDump(models.Model):
status = "ongoing" if self.dump_operation is None else "finished"
return f"{self.customer} - {status}"
@cached_property
def amount(self):
return (
self.dump_operation.unit_price
if self.dump_operation
else self.customer.amount
)
class ProductType(models.Model):
"""A product type.