2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Currency migrations - stop migrations when defaults change (#4975)

* make currency choices independend

* replace hard coded default currency

* use function for psql?

* use callable default

* revert some fields

* also migrat all currency codes
This commit is contained in:
Matthias Mair
2023-06-07 12:05:37 +02:00
committed by GitHub
parent 192c1ecb21
commit d7d3d8aa26
10 changed files with 28 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,7 @@
from django.db import migrations
import djmoney.models.fields
import common.settings
class Migration(migrations.Migration):
@ -14,6 +15,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='stockitem',
name='purchase_price',
field=djmoney.models.fields.MoneyField(blank=True, decimal_places=4, default_currency='USD', help_text='Single unit purchase price at time of purchase', max_digits=19, null=True, verbose_name='Purchase Price'),
field=djmoney.models.fields.MoneyField(blank=True, decimal_places=4, default_currency=common.settings.currency_code_default(), help_text='Single unit purchase price at time of purchase', max_digits=19, null=True, verbose_name='Purchase Price'),
),
]