This question has been flagged

Hi community!

I need your help, I cannot find this on the docs. I know that changes on a field can be tracked by the tracking=True parameter, but I would like to know what it means when the parameter has a number instead a boolean, like tracking=4 or tracking=5. Look at some examples:

odoo/sale_order.py at 15.0 · odoo/odoo (github.com)

odoo/sale_order.py at 15.0 · odoo/odoo (github.com)

This should be in the docs, but it isn't defined for now

Mixins and Useful Classes — Odoo 15.0 documentation

Mixins and Useful Classes — Odoo 16.0 documentation

Thanks in advance

Avatar
Discard
Best Answer

Hi,

Adding number to tracking is settings priority for the tracked fields, based on this value it will come in the firs position in the chatter.

It is explained here: https://www.youtube.com/watch?v=sidO-lQBZXs

Thanks

Avatar
Discard
Author

Thank for reply! It makes me sense

Best Answer

When the tracking parameter is set to an integer, it controls the number of previous versions of the field that will be stored in the database. This can be useful for auditing or for maintaining a history of changes to a field. The system will keep track of the previous versions of the field and make them available for inspection.


It's important to note that the tracking parameter will consume extra space in your database and may affect performance. The more versions you keep track of, the more space it will take. Also, it's important to consider the security implications of storing previous versions of sensitive dat


The versioned parameter must be set to True in order to use the tracking parameter. It allows the ORM to keep track of changes in the fields. This is an important feature when you want to keep history or audit changes on your dat


It's important to note that the tracking parameter only works with fields that are marked as versioned = True, and it's only available for the fields that are using the PostgreSQL databas


Also, when you set tracking =0, it means no version tracking will be done, and all the previous versions will be deleted from the database 

Avatar
Discard