Coverage for src/backend/InvenTree/part/settings.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 17:47 +0000

1"""User-configurable settings for the Part app.""" 

2 

3from common.settings import get_global_setting 

4 

5 

6def part_assembly_default(): 

7 """Returns the default value for the 'assembly' field of a Part object.""" 

8 return get_global_setting('PART_ASSEMBLY') 

9 

10 

11def part_template_default(): 

12 """Returns the default value for the 'is_template' field of a Part object.""" 

13 return get_global_setting('PART_TEMPLATE') 

14 

15 

16def part_virtual_default(): 

17 """Returns the default value for the 'is_virtual' field of Part object.""" 

18 return get_global_setting('PART_VIRTUAL') 

19 

20 

21def part_component_default(): 

22 """Returns the default value for the 'component' field of a Part object.""" 

23 return get_global_setting('PART_COMPONENT') 

24 

25 

26def part_purchaseable_default(): 

27 """Returns the default value for the 'purchasable' field for a Part object.""" 

28 return get_global_setting('PART_PURCHASEABLE') 

29 

30 

31def part_salable_default(): 

32 """Returns the default value for the 'salable' field for a Part object.""" 

33 return get_global_setting('PART_SALABLE') 

34 

35 

36def part_trackable_default(): 

37 """Returns the default value for the 'trackable' field for a Part object.""" 

38 return get_global_setting('PART_TRACKABLE')