Repository: inventree/InvenTree

Issue:
Add possibility to disable unused functions
I started using Inventree for my home inventory, there are many alternatives out there but none are simple to use.
The combination of the app for easy scanning codes and the server works really well.
For my use case I don't need the selling part and maybe also the buying part as I don't need to track every order I make, also because you need to add first a manufacturer and a seller for every part, this can be time-consuming.
I suggest then to add in the settings the possibility to enable every section as a module, like is structured Odoo for example.
This will make the interface cleaner and expandable, maybe with plugins.



Discussion:
@lettore not sure I understand what you mean; selling / purchasing only becomes available for a part if it is enabled for it. Have you disabled the functions for the part and do they stil show up? You can control the default settings for a new part in the settings.

We have several ways to do [plugins](https://inventree.readthedocs.io/en/latest/extend/plugins/) and I am working on a deeper integration but taht will take time as there are a lot of security concerns.
> @lettore not sure I understand what you mean; selling / purchasing only becomes available for a part if it is enabled for it. Have you disabled the functions for the part and do they stil show up? You can control the default settings for a new part in the settings.
> 
> We have several ways to do [plugins](https://inventree.readthedocs.io/en/latest/extend/plugins/) and I am working on a deeper integration but taht will take time as there are a lot of security concerns.

What I mean is not to see the sell button, the sales part in the main interface.
![image](https://user-images.githubusercontent.com/34779795/129002182-23bc6e84-e1f7-4b33-82ab-18f6cc0f84b9.png)
Many switches in every part that are not used if I'm not going to sell anything
![image](https://user-images.githubusercontent.com/34779795/129002491-485dcb95-b81e-4361-af5d-ca662a1ef8a7.png)
It's just for have a cleaner interface.

@lettore "Settings" --> "User Settings" --> "Home Page" --> Disable both `Show outstanding SOs` and `Show overdue SOs`:

![image](https://user-images.githubusercontent.com/4020546/129077505-6843c5ca-66ce-401f-8e57-1e76aff6a8b6.png)

Home page will look like this:

![image](https://user-images.githubusercontent.com/4020546/129077554-7d0e503a-8435-4fe6-9407-035b024ca140.png)

@lettore fair enough suggestion, I think it would be reasonable to at least be able to hide the "Build", "Buy", "Sell" tabs.

Obviously hiding these tabs would also disable lots of functionality on other pages too
One way to disable them is with permissions. For instance, here is an example of group's permissions disabling view of POs and SOs:

![image](https://user-images.githubusercontent.com/4020546/129575740-529d047e-28f7-4d61-b846-df04daa6aba5.png)

And here is what the UI shows for a user of that group:

![image](https://user-images.githubusercontent.com/4020546/129575804-1aa28808-bbbd-4a02-89b0-c22a3e4f9b72.png)


Resolving patch:
diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py
--- a/InvenTree/common/models.py
+++ b/InvenTree/common/models.py
@@ -783,6 +783,44 @@ class InvenTreeSetting(BaseInvenTreeSetting):
             'description': _('Prefix value for purchase order reference'),
             'default': 'PO',
         },
+
+        # enable/diable ui elements
+        'BUILD_FUNCTION_ENABLE': {
+            'name': _('Enable build'),
+            'description': _('Enable build functionality in InvenTree interface'),
+            'default': True,
+            'validator': bool,
+        },
+        'BUY_FUNCTION_ENABLE': {
+            'name': _('Enable buy'),
+            'description': _('Enable buy functionality in InvenTree interface'),
+            'default': True,
+            'validator': bool,
+        },
+        'SELL_FUNCTION_ENABLE': {
+            'name': _('Enable sell'),
+            'description': _('Enable sell functionality in InvenTree interface'),
+            'default': True,
+            'validator': bool,
+        },
+        'STOCK_FUNCTION_ENABLE': {
+            'name': _('Enable stock'),
+            'description': _('Enable stock functionality in InvenTree interface'),
+            'default': True,
+            'validator': bool,
+        },
+        'SO_FUNCTION_ENABLE': {
+            'name': _('Enable SO'),
+            'description': _('Enable SO functionality in InvenTree interface'),
+            'default': True,
+            'validator': bool,
+        },
+        'PO_FUNCTION_ENABLE': {
+            'name': _('Enable PO'),
+            'description': _('Enable PO functionality in InvenTree interface'),
+            'default': True,
+            'validator': bool,
+        },
     }
 
     class Meta:


Test patch: