Sending periodic digest emails
The Odoo framework has built-in support for sending out periodic digest emails. With digest emails, you can send an email with information about business KPIs. In this recipe, we will send data about rented books to the librarian (or any other authorized person).
Getting ready
For this recipe, we will be using the my_library
module from the previous recipe, Logging user changes in a chatter.
How to do it...
Follow these steps to generate digest emails for book rent records:
- Inherit the
digest.digest
model and add fields for the KPIs:class Digest(models.Model): Â Â Â Â _inherit = 'digest.digest' Â Â Â Â kpi_book_rent = fields.Boolean('Book Rent') Â Â Â Â kpi_book_rent_value = fields.Integer(compute='_compute_kpi_book_rent_value') Â Â Â Â def _compute_kpi_book_rent_value(self): Â Â Â Â Â Â Â Â for record in self...