mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-04 12:40:57 +00:00
Enforce at least one base currency to be selected
This commit is contained in:
@ -69,7 +69,7 @@ class Currency(models.Model):
|
|||||||
cur.save()
|
cur.save()
|
||||||
|
|
||||||
# If there are no currencies set as the base currency, set this as base
|
# If there are no currencies set as the base currency, set this as base
|
||||||
if not Currency.objects.filter(base=True).exists():
|
if not Currency.objects.exclude(pk=self.pk).filter(base=True).exists():
|
||||||
self.base = True
|
self.base = True
|
||||||
|
|
||||||
# If this is the base currency, ensure value is set to unity
|
# If this is the base currency, ensure value is set to unity
|
||||||
|
Reference in New Issue
Block a user