Adding custom settings options
In Odoo, you can provide optional features through the Settings options. The user can enable or disable this option at any time. We will illustrate how to create Settings options in this recipe.
Getting ready
In previous recipes, we have added buttons so that non-librarian users can borrow and return books. This is not the case for every library; however, we will create a settings option to enable and disable this feature. We will do this by hiding these buttons. In this recipe, we will use the same my_library
module from the previous recipes.
How to do it...
In order to create custom settings options, follow these steps:
- Add a new group in the
my_library/security/groups.xml
file:<record id="group_self_borrow" model="res.groups"> <field name="name">Self borrow</field> ...