InvenTree/InvenTree/part/settings.py
Oliver Walters c95f124578 Add some helper magic for setting objects
- If the setting is defined as a "bool" then the returned value is automatically cast to a bool
- Add some more unit testing
2020-11-09 23:44:54 +11:00

41 lines
886 B
Python

"""
User-configurable settings for the Part app
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from common.models import InvenTreeSetting
def part_component_default():
"""
Returns the default value for the 'component' field of a Part object
"""
return InvenTreeSetting.get_setting('PART_COMPONENT')
def part_purchaseable_default():
"""
Returns the default value for the 'purchasable' field for a Part object
"""
return InvenTreeSetting.get_setting('PART_PURCHASEABLE')
def part_salable_default():
"""
Returns the default value for the 'salable' field for a Part object
"""
return InvenTreeSetting.get_setting('PART_SALABLE')
def part_trackable_default():
"""
Returns the defualt value fro the 'trackable' field for a Part object
"""
return InvenTreeSetting.get_setting('PART_TRACKABLE')