Migrate to global currency system in commerce app

Removed per-product currency in favor of a global site currency managed via SiteConfiguration. Updated models, views, templates, and Stripe integration to use the global currency. Added migration, management command for migration, and API endpoint for currency info. Improved permissions and filtering for orders, reviews, and carts. Expanded supported currencies in configuration.
This commit is contained in:
2026-01-24 21:51:56 +01:00
parent 8f6d864b4b
commit 775709bd08
19 changed files with 371 additions and 102 deletions

View File

@@ -0,0 +1,36 @@
# Generated migration to remove Product.currency field and use global currency system
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('commerce', '0002_alter_productimage_options_carrier_deutschepost_and_more'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='currency',
),
migrations.AlterField(
model_name='order',
name='currency',
field=models.CharField(
default='',
help_text='Order currency - auto-filled from site configuration',
max_length=10
),
),
migrations.AlterField(
model_name='discountcode',
name='amount',
field=models.DecimalField(
blank=True,
decimal_places=2,
help_text='Fixed discount amount in site currency',
max_digits=10,
null=True
),
),
]