
Learn how to set tracking levels in Odoo to prioritize tracked field changes in the chatter, ensuring important updates are displayed first.
Odoo provides tracking functionality to monitor changes in specific fields. For better control over field change notifications, you can set tracking levels, which determine the sequence of changes in the record's chatter. This blog explains how to set tracking levels to organize tracking values in a desired order using the tracking
attribute in Odoo.
By assigning different tracking levels (1, 2, 3, etc.), you can control the order in which field updates appear in the chatter. Fields with lower tracking values will display before those with higher tracking values. This feature is particularly useful when some changes are more significant or need to be highlighted first in the chatter view.
Let’s look at how to apply tracking levels in an Odoo model. Here, we will track three fields with different tracking priorities:
<from odoo import models, fields>
class CustomModel(models.Model):
_name = 'custom.model'
_inherit = 'mail.thread'
# Fields with specific tracking levels
name = fields.Char(string="Name", tracking=1)
email = fields.Char(string="Email", tracking=2)
phone = fields.Char(string="Phone", tracking=3)
In this example:
tracking=1
, so it appears first in the chatter when changes are made.tracking=2
, placing it after the name in the chatter.tracking=3
, so changes in this field appear last.Customizing tracking levels provides several advantages:
Setting tracking levels in Odoo is particularly helpful in the following cases:
By assigning tracking levels, you can control the sequence of tracked changes in Odoo, improving workflow management and data accessibility. This feature is easy to implement and can enhance the clarity of record updates in your Odoo instance.
Your email address will not be published. Required fields are marked *