diff --git a/doc/reference/mixins.rst b/doc/reference/mixins.rst index 25bf8d4a41b..c172c79dd2a 100644 --- a/doc/reference/mixins.rst +++ b/doc/reference/mixins.rst @@ -738,6 +738,65 @@ you to make your alias easily configurable from the record's form view. res = super(BusinessExpense, self).message_new(msg, custom_values=defaults) return res +.. _reference/mixins/mail/activities: + +Activities tracking +------------------- + +Activities are actions users have to take on a document like making a phone call +or organizing a meeting. Activities come with the mail module as they are +integrated in the Chatter but are *not bundled with mail.thread*. Activities +are records of the ``mail.activity`` class, which have a type (``mail.activity.type``), +name, description, scheduled time (among others). Pending activities are visible +above the message history in the chatter widget. + +You can integrate activities using the ``mail.activity.mixin`` class on your object +and the specific widgets to display them (via the field ``activity_ids``) in the form +view and kanban view of your records (``mail_activity`` and ``kanban_activity`` +widgets, respectively). + +.. admonition:: Example + + Organizing a business trip is a tedious process and tracking needed activities + like ordering plane tickets or a cab for the airport could be useful. To do so, + we will add the activities mixin on our model and display the next planned activities + in the message history of our trip. + + .. code-block:: python + + class BusinessTrip(models.Model): + _name = 'business.trip' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Business Trip' + + name = fields.Char() + # [...] + + We modify the form view of our trips to display their next activites: + + .. code-block:: xml + + + business.trip.form + business.trip + +
+ +
+ + + +
+
+
+
+ +You can find concrete examples of integration in the following models: + +* ``crm.lead`` in the CRM (*crm*) Application +* ``sale.order`` in the Sales (*sale*) Application +* ``project.task`` in the Project (*poject*) Application + .. _reference/mixins/website: