How to Change Order of Tracking Values in Odoo

Abid Patel
26-Oct-2024 Updated : 26-Oct-2024

Learn how to set tracking levels in Odoo to prioritize tracked field changes in the chatter, ensuring important updates are displayed first.

How to Change Order of Tracking Values in Odoo

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.

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

Example: Setting Tracking Levels in Odoo

Let’s look at how to apply tracking levels in an Odoo model. Here, we will track three fields with different tracking priorities:

python
<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:

  • Name has tracking=1, so it appears first in the chatter when changes are made.
  • Email has tracking=2, placing it after the name in the chatter.
  • Phone has tracking=3, so changes in this field appear last.

Benefits of Setting Tracking Levels

Customizing tracking levels provides several advantages:

  • ▹ Ensures that critical changes, such as updates to essential fields, are prioritized and displayed first.
  • ▹ Makes field tracking more organized, particularly in records with multiple tracked fields.
  • ▹ Improves readability and allows users to locate high-priority updates quickly.

Use Cases for Tracking Levels

Setting tracking levels in Odoo is particularly helpful in the following cases:

  • Sales and CRM Management: Track changes to lead or opportunity stages, ensuring crucial status updates appear at the top.
  • Inventory and Procurement: Prioritize changes to quantities or availability fields to streamline stock tracking.
  • HR and Employee Management: Show updates to key fields like job position or department at the top of employee records.

Conclusion

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.

Make a Comment

Your email address will not be published. Required fields are marked *