diff --git a/bakeup/shop/models.py b/bakeup/shop/models.py index a956255..ca8b523 100644 --- a/bakeup/shop/models.py +++ b/bakeup/shop/models.py @@ -664,6 +664,13 @@ class Meta: def __str__(self): return "{}x {}".format(self.quantity, self.product) + def save(self, *args, **kwargs): + if not self.price and self.product.sale_price: + self.price = self.product.sale_price.price.amount + if self.price and self.quantity: + self.price_total = self.price * self.quantity + super().save(*args, **kwargs) + def get_product(self): if self.product.product_template: return self.product.product_template diff --git a/bakeup/templates/tables/customer_order_positions_column.html b/bakeup/templates/tables/customer_order_positions_column.html index c0d0243..691a94f 100644 --- a/bakeup/templates/tables/customer_order_positions_column.html +++ b/bakeup/templates/tables/customer_order_positions_column.html @@ -1,5 +1,5 @@ -