feat: payments working

This commit is contained in:
Pablo Moreno
2025-01-12 23:53:38 +01:00
parent 26e23d47f3
commit 074332092e
8 changed files with 263 additions and 168 deletions
+8
View File
@@ -429,6 +429,14 @@ class Order(TimestampedModel):
max_length=32, blank=True, verbose_name=_("teléfono de contacto")
)
shipping_method = models.ForeignKey(
"shop.ShippingMethod",
blank=True,
null=True,
on_delete=models.SET_NULL,
verbose_name=_("método de envío"),
)
def calculate_total_from_lines(self):
self.base_total = self.lines.aggregate(base_total=models.Sum("base_total")).get(
"base_total"