InvenTree/InvenTree/common/settings.py
Oliver Walters d0fb69e67d Add option to enable / disable stock expiry feature
- Simply hides fields in form views
2021-01-05 08:50:07 +11:00

32 lines
617 B
Python

"""
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
def stock_expiry_enabled():
"""
Returns True if the stock expiry feature is enabled
"""
return InvenTreeSetting.get_setting('STOCK_ENABLE_EXPIRY')