Managing activities from a kanban card
Odoo uses activities to schedule actions on records. These activities can be managed in form view and the kanban view. In this recipe, we will see how you can manage activities from the kanban view card. We will add an activity widget to the cards of the rent kanban.
Getting started
For this recipe, we will be using the my_library
module from the previous recipe.
How to do it...
Follow these steps to add and mange activity from the kanban view:
- Add mail dependencies to the
manifest
file:'depends': ['base', 'mail'],
- Inherit
activity mixin
in thelibrary.book.rent
model:class LibraryBookRent(models.Model): Â Â Â Â _name = 'library.book.rent' Â Â Â Â _inherit = ['mail.thread', 'mail.activity.mixin']
- Add the
activity_state
field to the kanban view under thecolor
field:<field name="color" /> <field name="...