How to disable functionality from settings in a custom module
Hi, I am a developer working on a custom module in Odoo 18 and I want to give the user the option to enable or disable some functionality from settings. I have a general grasp of how to use the settings by adding a field in the environment settings to enable or disable my functionality, but I am not sure on how to stop the logic from executing and hiding some parts of the custom views with that field.
For the views, the most straighforward option would be to use the invisible attribute, and for the models I can add an If statement before each function,but that doesn't seem really elegant.
Is there a recommended way on how to do this? Thanks.
Posted Jul 4, 2025, 1:20 AM UTC
24