feat: Add facility to completely hide parts of the interface (#12842)

* fix typing issue for pylance engine

* add flags to mark rough function of setting

* update pr version

* fix settings serialisation

* render security warnings

* move Transfer Orders

* respect return order hiding

* almost all confirm texts will have a warning

* add settings for sales, purchase and buildorder deactivation

* make permission check also ensure gloablsetting for view is available; reduce number of chained gates

* document possible missing check

* ensure we can still show the sales tab

* add additional warning to group cleanup

* hide more ui parts conditionally

* add tests for new code and remove duplication

* fix test

* alternative approach to fix SSO path

* remove patch; now done in serializer

* ignore ldap section
This commit is contained in:
Matthias Mair authored and GitHub committed 2026-09-15 21:13:59 +10:00
1 parent 1afe583ea5
commit 63a434c652
40 files changed
+339 -157

No files matched your search

+5 -20
View File
@@ -125,6 +125,11 @@ class UserAPITests(InvenTreeAPITestCase):
self.assertEqual(response.data['is_staff'], False)
self.assertEqual(response.data['is_superuser'], False)
self.assertEqual(response.data['is_active'], True)
self.assertTrue(
EmailAddress.objects.filter(
user__username=data['username'], email=data['email'], primary=True
).exists()
)
# Try to adjust the 'is_superuser' field
# Only a "superuser" can set this field
@@ -372,26 +377,6 @@ class SuperuserAPITests(InvenTreeAPITestCase):
resp = self.put(url, {'password': 'inventree'}, expected_code=200)
self.assertEqual(resp.data, {})
def test_email_address_sync_signal(self):
"""Test emailadress sync."""
user = User.objects.create(username='start', email='start@example.org')
self.assertTrue(
EmailAddress.objects.filter(
user=user, email='start@example.org', primary=True
).exists()
)
# change should trigger emailaddress update
user.email = 'updated@example.org'
user.save()
self.assertFalse(
EmailAddress.objects.filter(user=user, email='start@example.org').exists()
)
updated = EmailAddress.objects.get(user=user, primary=True)
self.assertEqual(updated.email, 'updated@example.org')
self.assertFalse(updated.verified)
class UserTokenTests(InvenTreeAPITestCase):
"""Tests for user token functionality."""