Files
odoo_source/addons/test_mail/security
miad-odoo d31b3ecb84 [IMP] mail: add mixin to compute many2one duration
This commit implements a mixin, `MailTrackingDurationMixin`, that can be added
to a model with a `many2one` field. It computes the time a record spends in each
value the many2one field takes and stores it in a JSON field
(`duration_tracking`).

The primary use is with the StatusBarDurationField
(`widget='statusbar_duration'`), to compute and display the time a record has
spent in each stage in the form view statusbar.

To specify on what field the computation has to be done, the model that inherits
from this mixin has to specify  `_track_duration_field`.  (e.g.
_track_duration_field = 'stage_id')

Computation is based on `mail.tracking.value` messages, so tracking has to be
activated for that field.

Task-3032773

Part-of: odoo/odoo#108554
2023-07-18 13:07:41 +02:00
..