mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-07 10:51:17 +00:00
Add 'currency' option for company
- e.g. an external supplier might have a default currency - Adds a form input which only allows selection of allowed currency codes - Add unit testing for currency validation
This commit is contained in:
1 parent
ebac06ebee
commit
1532be9c1e
7 files changed
+158
-19
No files matched your search
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
User-configurable settings for the common app
|
||||
"""
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from moneyed import CURRENCIES
|
||||
|
||||
from common.models import InvenTreeSetting
|
||||
|
||||
|
||||
def currency_code_default():
|
||||
"""
|
||||
Returns the default currency code (or USD if not specified)
|
||||
"""
|
||||
|
||||
code = InvenTreeSetting.get_setting('INVENTREE_DEFAULT_CURRENCY')
|
||||
|
||||
if code not in CURRENCIES:
|
||||
code = 'USD'
|
||||
|
||||
return code
|
||||
Reference in new issue
Block a user