mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-30 22:29:32 +00:00
Pre-filter allowed products in backend for counter click
This commit is contained in:
1 parent
c37288c285
commit
eea237b813
2 files changed
+55
-54
No files matched your search
@@ -428,13 +428,6 @@ class Product(models.Model):
|
||||
def profit(self):
|
||||
return self.selling_price - self.purchase_price
|
||||
|
||||
def get_actual_price(self, counter: Counter, customer: Customer):
|
||||
"""Return the price of the article taking into account if the customer has a special price
|
||||
or not in the counter it's being purchased on"""
|
||||
if counter.customer_is_barman(customer):
|
||||
return self.special_selling_price
|
||||
return self.selling_price
|
||||
|
||||
|
||||
class CounterQuerySet(models.QuerySet):
|
||||
def annotate_has_barman(self, user: User) -> Self:
|
||||
|
||||
Reference in new issue
Block a user