From 7322a0c1cb8ab60597bb80534724d4b01da1ddc5 Mon Sep 17 00:00:00 2001 From: imperosol Date: Thu, 5 Mar 2026 18:15:24 +0100 Subject: [PATCH] remove `Product.selling_price` and `Product.special_selling_price` --- counter/migrations/0038_price.py | 16 +++++++++++++++- counter/models.py | 9 +++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/counter/migrations/0038_price.py b/counter/migrations/0038_price.py index e6c234da..5a06100e 100644 --- a/counter/migrations/0038_price.py +++ b/counter/migrations/0038_price.py @@ -72,7 +72,10 @@ class Migration(migrations.Migration): "label", models.CharField( default="", - help_text="A short label for easier differentiation if a user can see multiple prices.", + help_text=( + "A short label for easier differentiation " + "if a user can see multiple prices." + ), max_length=32, verbose_name="label", blank=True, @@ -104,5 +107,16 @@ class Migration(migrations.Migration): ], options={"verbose_name": "price"}, ), + migrations.AlterField( + model_name="product", + name="tray", + field=models.BooleanField( + default=False, + help_text="Buy five, get the sixth free", + verbose_name="tray price", + ), + ), migrations.RunPython(migrate_prices, reverse_code=migrations.RunPython.noop), + migrations.RemoveField(model_name="product", name="selling_price"), + migrations.RemoveField(model_name="product", name="special_selling_price"), ] diff --git a/counter/models.py b/counter/models.py index cf2e0813..9cd08eee 100644 --- a/counter/models.py +++ b/counter/models.py @@ -377,11 +377,6 @@ class Product(models.Model): _("purchase price"), help_text=_("Initial cost of purchasing the product"), ) - selling_price = CurrencyField(_("selling price")) - special_selling_price = CurrencyField( - _("special selling price"), - help_text=_("Price for barmen during their permanence"), - ) icon = ResizedImageField( height=70, force_format="WEBP", @@ -394,7 +389,9 @@ class Product(models.Model): Club, related_name="products", verbose_name=_("club"), on_delete=models.CASCADE ) limit_age = models.IntegerField(_("limit age"), default=0) - tray = models.BooleanField(_("tray price"), default=False) + tray = models.BooleanField( + _("tray price"), help_text=_("Buy five, get the sixth free"), default=False + ) buying_groups = models.ManyToManyField( Group, related_name="products", verbose_name=_("buying groups"), blank=True )