make Selling.payment_method a SmallIntegerField

This commit is contained in:
imperosol
2025-11-19 19:56:21 +01:00
parent 2a5893aa79
commit 78fe4e52ca
8 changed files with 53 additions and 25 deletions

View File

@@ -110,7 +110,9 @@ class Basket(models.Model):
)["total"]
)
def generate_sales(self, counter, seller: User, payment_method: str):
def generate_sales(
self, counter, seller: User, payment_method: Selling.PaymentMethod
):
"""Generate a list of sold items corresponding to the items
of this basket WITHOUT saving them NOR deleting the basket.
@@ -267,7 +269,7 @@ class Invoice(models.Model):
customer=customer,
unit_price=i.product_unit_price,
quantity=i.quantity,
payment_method="CARD",
payment_method=Selling.PaymentMethod.CARD,
date=self.date,
)
new.save()