Logging user changes in a chatter
The Odoo framework provides a built-in facility to log field changes in a chatter. In this recipe, we will enable logging on some of the fields so that when changes are made in them, Odoo will add logs in the chatter.
Getting ready
For this recipe, we will be using the my_hostel
module from the previous recipe, Managing the email alias. In this recipe, we will log changes from a few fields in the hostel.student
model.
How to do it...
Modify the definitions of the fields, to enable logs for the fields when you change them. This is shown in the following code snippet:
class HostelStudent(models.Model): _name = "hostel.student" _description = "Hostel Student Information" _inherit = ['mail.thread', 'mail.activity.mixin'] name = fields.Char("Student Name") email = fields.Char("Student Email"...