Merge branch 'master' of https://github.com/inventree/InvenTree into plugin-2037

This commit is contained in:
Matthias 2021-11-20 13:50:13 +01:00
commit d8963fd5b1
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
3 changed files with 14 additions and 2 deletions

View File

@ -45,6 +45,18 @@ class SettingsSerializer(InvenTreeModelSerializer):
return results
def get_value(self, obj):
"""
Make sure protected values are not returned
"""
result = obj.value
# never return protected values
if obj.is_protected:
result = '***'
return result
class GlobalSettingsSerializer(SettingsSerializer):
"""

View File

@ -59,7 +59,7 @@ def ExportBom(part, fmt='csv', cascade=False, max_levels=None, parameter_data=Fa
uids = []
def add_items(items, level, cascade):
def add_items(items, level, cascade=True):
# Add items at a given layer
for item in items:

View File

@ -1587,7 +1587,7 @@ class Part(MPTTModel):
# Exclude any parts that this part is used *in* (to prevent recursive BOMs)
used_in = self.get_used_in().all()
parts = parts.exclude(id__in=[item.part.id for item in used_in])
parts = parts.exclude(id__in=[part.id for part in used_in])
return parts