make currency choices independend

This commit is contained in:
Matthias Mair 2023-06-05 23:24:42 +02:00
parent 99d122baa9
commit ab84a7ff83
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
6 changed files with 12 additions and 6 deletions

View File

@ -2,6 +2,7 @@
from django.db import migrations, connection
import djmoney.models.fields
import common.models
class Migration(migrations.Migration):
@ -19,6 +20,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='supplierpricebreak',
name='price_currency',
field=djmoney.models.fields.CurrencyField(choices=[('AUD', 'Australian Dollar'), ('CAD', 'Canadian Dollar'), ('EUR', 'Euro'), ('NZD', 'New Zealand Dollar'), ('GBP', 'Pound Sterling'), ('USD', 'US Dollar'), ('JPY', 'Yen')], default='USD', editable=False, max_length=3),
field=djmoney.models.fields.CurrencyField(choices=common.settings.currency_code_mappings, default='USD', editable=False, max_length=3),
),
]

View File

@ -2,6 +2,7 @@
from django.db import migrations
import djmoney.models.fields
import common.models
class Migration(migrations.Migration):
@ -19,6 +20,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='purchaseorderlineitem',
name='purchase_price_currency',
field=djmoney.models.fields.CurrencyField(choices=[('AUD', 'Australian Dollar'), ('CAD', 'Canadian Dollar'), ('EUR', 'Euro'), ('NZD', 'New Zealand Dollar'), ('GBP', 'Pound Sterling'), ('USD', 'US Dollar'), ('JPY', 'Yen')], default='USD', editable=False, max_length=3),
field=djmoney.models.fields.CurrencyField(choices=common.settings.currency_code_mappings, default='USD', editable=False, max_length=3),
),
]

View File

@ -1,6 +1,7 @@
# Generated by Django 3.2 on 2021-05-04 19:46
from django.db import migrations
import common.models
import djmoney.models.fields
@ -19,6 +20,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='salesorderlineitem',
name='sale_price_currency',
field=djmoney.models.fields.CurrencyField(choices=[('AUD', 'Australian Dollar'), ('GBP', 'British Pound'), ('CAD', 'Canadian Dollar'), ('EUR', 'Euro'), ('JPY', 'Japanese Yen'), ('NZD', 'New Zealand Dollar'), ('USD', 'US Dollar')], default='USD', editable=False, max_length=3),
field=djmoney.models.fields.CurrencyField(choices=common.settings.currency_code_mappings, default='USD', editable=False, max_length=3),
),
]

View File

@ -2,6 +2,7 @@
from django.db import migrations
import djmoney.models.fields
import common.models
class Migration(migrations.Migration):
@ -19,6 +20,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='partsellpricebreak',
name='price_currency',
field=djmoney.models.fields.CurrencyField(choices=[('AUD', 'Australian Dollar'), ('CAD', 'Canadian Dollar'), ('EUR', 'Euro'), ('NZD', 'New Zealand Dollar'), ('GBP', 'Pound Sterling'), ('USD', 'US Dollar'), ('JPY', 'Yen')], default='USD', editable=False, max_length=3),
field=djmoney.models.fields.CurrencyField(choices=common.settings.currency_code_mappings, default='USD', editable=False, max_length=3),
),
]

View File

@ -2,6 +2,7 @@
import InvenTree.fields
import django.core.validators
import common.models
from django.db import migrations, models
import django.db.models.deletion
import djmoney.models.fields
@ -19,7 +20,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', InvenTree.fields.RoundingDecimalField(decimal_places=5, default=1, help_text='Price break quantity', max_digits=15, validators=[django.core.validators.MinValueValidator(1)], verbose_name='Quantity')),
('price_currency', djmoney.models.fields.CurrencyField(choices=[('AUD', 'Australian Dollar'), ('CAD', 'Canadian Dollar'), ('EUR', 'Euro'), ('NZD', 'New Zealand Dollar'), ('GBP', 'Pound Sterling'), ('USD', 'US Dollar'), ('JPY', 'Yen')], default='USD', editable=False, max_length=3)),
('price_currency', djmoney.models.fields.CurrencyField(choices=common.settings.currency_code_mappings, default='USD', editable=False, max_length=3)),
('price', djmoney.models.fields.MoneyField(decimal_places=4, default_currency='USD', help_text='Unit price at specified quantity', max_digits=19, null=True, verbose_name='Price')),
('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='internalpricebreaks', to='part.part', verbose_name='Part')),
],

View File

@ -2,6 +2,7 @@
import InvenTree.fields
import common.settings
import common.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
@ -35,7 +36,7 @@ class Migration(migrations.Migration):
name='PartPricing',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('currency', models.CharField(choices=[('AUD', 'Australian Dollar'), ('CAD', 'Canadian Dollar'), ('CNY', 'Chinese Yuan'), ('EUR', 'Euro'), ('GBP', 'British Pound'), ('JPY', 'Japanese Yen'), ('NZD', 'New Zealand Dollar'), ('USD', 'US Dollar')], default=common.settings.currency_code_default, help_text='Currency used to cache pricing calculations', max_length=10, verbose_name='Currency')),
('currency', models.CharField(choices=common.settings.currency_code_mappings, default=common.settings.currency_code_default, help_text='Currency used to cache pricing calculations', max_length=10, verbose_name='Currency')),
('updated', models.DateTimeField(auto_now=True, help_text='Timestamp of last pricing update', verbose_name='Updated')),
('scheduled_for_update', models.BooleanField(default=False)),
('bom_cost_min_currency', djmoney.models.fields.CurrencyField(choices=[], default='', editable=False, max_length=3)),