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 the hostel room to the rector (or any other authorized person).
Getting ready
For this recipe, we will be using the my_hostel
module from the previous recipe, Logging user changes in a chatter.
How to do it...
Follow these steps to generate digest emails for room rent records:
- Inherit the
digest.digest
model and add fields for the KPIs:class Digest(models.Model): Â Â Â _inherit = 'digest.digest' Â Â Â kpi_room_rent = fields.Boolean('Room Rent') Â Â Â kpi_room_rent_value = fields.Integer(compute='_compute_kpi_room_rent_value') Â Â Â def _compute_kpi_room_rent_value(self): Â Â Â Â Â Â Â for record in self: Â Â Â Â Â ...