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...