diff --git a/InvenTree/common/serializers.py b/InvenTree/common/serializers.py index 4a27e3f30e..60eb609dc1 100644 --- a/InvenTree/common/serializers.py +++ b/InvenTree/common/serializers.py @@ -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): """ diff --git a/InvenTree/part/bom.py b/InvenTree/part/bom.py index fd31aba339..1fc747655d 100644 --- a/InvenTree/part/bom.py +++ b/InvenTree/part/bom.py @@ -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: diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index cec21becc2..638c956ffa 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -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