Home › Curriculum › Odoo Developer › mail.thread, activities, tracking and notifications
Business logic and automation · 12 min · 17–20mail.thread, activities, tracking and notifications
Adding the chatter to models, tracking fields, posting messages, scheduling activities, followers and templates from code.
In this lesson
- Adding the chatter and tracking (Odoo 20 change)
- Posting, following and activities from code
- Aliases and incoming mail
Key points
- _inherit = ['mail.thread', 'mail.activity.mixin']; tracking=True
- Odoo 20: tracking messages generated on the fly; review code reading tracking values
- message_post (note vs comment), message_subscribe, activity_schedule
- mail.alias + message_new/message_update for incoming mail
Real-world example
Credit releases needed an audit trail. Adding mail.thread with tracking on state and amount, posting a note with the approver's comment, and scheduling an activity for the salesperson on approval gave auditors the full history on each record.
Questions and answers
What does mail.activity.mixin add?
Activities (scheduled tasks) on the model.
How do you send a template from code?
message_post_with_source(template) or the template's send_mail(res_id).