Refactor commerce models and enhance payment logic

Refactored commerce models to remove language prefixes from status choices, improved order and payment validation, and enforced business rules for payment and shipping combinations. Updated order item and cart calculations to use VAT-inclusive prices, added unique constraints and indexes to reviews, and improved stock management logic. Added new Stripe client methods for session and refund management, and updated Zasilkovna and Deutsche Post models for consistency. Minor fixes and improvements across related tasks, URLs, and configuration models.
This commit is contained in:
2026-01-20 23:45:21 +01:00
parent b38d126b6c
commit c0bd24ee5e
10 changed files with 353 additions and 96 deletions

View File

@@ -2,6 +2,7 @@ from account.tasks import send_email_with_context
from configuration.models import SiteConfiguration
from celery import shared_task
from celery.schedules import crontab
@shared_task
def send_contact_me_email_task(client_email, message_content):
@@ -14,4 +15,16 @@ def send_contact_me_email_task(client_email, message_content):
subject="Poptávka z kontaktního formuláře!!!",
template_path="email/contact_me.html",
context=context,
)
def send_newly_added_items_to_store_email_task_last_week(item_id):
send_email_with_context(
recipients=SiteConfiguration.get_solo().contact_email,
subject="Nový produkt přidán do obchodu",
template_path="email/new_item_added.html",
context={
"item": item,
}
)