2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-04 04:30:56 +00:00

InvenTreeUserSettings added

This commit is contained in:
2021-07-20 01:35:58 +02:00
parent ec53099872
commit ce3f7b698d
2 changed files with 56 additions and 0 deletions

View File

@ -746,6 +746,33 @@ class InvenTreeSetting(BaseInvenTreeSetting):
verbose_name_plural = "InvenTree Settings"
class InvenTreeUserSetting(BaseInvenTreeSetting):
"""
An InvenTreeSetting object with a usercontext
"""
GLOBAL_SETTINGS = {
'PART_ASSEMBLY': {
'name': _('Assembly'),
'description': _('Parts can be assembled from other components by default'),
'default': False,
'validator': bool,
},
}
class Meta:
verbose_name = "InvenTree User Setting"
verbose_name_plural = "InvenTree User Settings"
user = models.ForeignKey(
User,
on_delete=models.CASCADE,
blank=True, null=True,
verbose_name=_('User'),
help_text=_('User'),
)
class PriceBreak(models.Model):
"""
Represents a PriceBreak model