
Odoo 14 Development Cookbook
By :

Odoo provides inbuilt features to enable archive and unarchive options for records. This will help the user to hide records that are no longer important. In this recipe, we will add an archive/unarchive option for a book. We can archive a book once it is not available.
For this recipe, we will be using the my_library
module from the previous recipe.
Archive and unarchive mostly work automatically. The options are available on a record if the model has a Boolean field named active
. We already have an active
field in the library.book
model. But if you have not added it, follow these steps to add the active
field:
active
Boolean field to the library.book
model like this:active = fields.Boolean(default=True)
active
field in the form view:<field name="active" invisible="1"/>
Update the my_library
module to apply the changes. Now, you will be able...