Hi,
Track visibility is used to track the changes made to the fields, as our system is a multi-user system and the different person can access the same record. There might be cases where we have to keep track of who changed the field values. In these cases, we can use track_visibilty.
So let us look at how we can do it in our model.
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
price_unit = fields.Float('Unit Price', required=True, digits='Product Price', default=0.0, track_visibility = 'always')
(or)
price_unit = fields.Float('Unit Price', required=True, digits='Product Price', default=0.0, track_visibility = ‘onchange’)
Track Visibility: onchange (if it should be displayed in the notification only if the field changed) or always (if the value should always be displayed in change notifications even if this particular field did not change - useful to make notification more explanatory by always adding the name field).
Regards