mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 22:08:49 +00:00
Enforce at least one base currency to be selected
This commit is contained in:
parent
654fbc3847
commit
f24496c5a2
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user