Files
odoo_source/addons/hr_holidays/data/mail_data.xml
T
Thibault Delavallée 1d71c06233 [IMP] hr_holidays: improve activity management on leave model
This commit improves leave request and allocation management through a
better integration of activities and addition of automated activities.
Several things are done in this commit :

 * leave and allocation models do not inherit from mail.activity.mixin.
   This commit adds the inherit so that HR users and managers can now
   schedule and manage activities on leave and allocation requests. This
   will help them in their daily job;
 * automatic activities generation is added for leave and allocation.
   Activities are generated for approval and second approval. They are also
   automatically set as done when validating or unlinked when refusing or
   resetting to avoid bloating users with unnecessary activities;
 * a menu to configure activity types is added. Indeed HR managers should be
   able to see and configure activity types related to their job;
 * filters are added to be able to use the systray and to filter the kanban
   view based on activities

Having automated activities allow to replace some messages and tracking
that were implemented to warn people of leave and allocation to approve
or validate. This commit therefore

 * simplifies the tracking as only approved or refused state now trigger
   a subtype;
 * removes to approve and to validate subtypes on leave and allocation
   model as well as their parent subtypes on the department. This allows
   to simplify chatter a lot in hr_holidays app;
2018-03-27 15:19:10 +02:00

88 lines
4.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- Leave specific activities -->
<record id="mail_act_leave_approval" model="mail.activity.type">
<field name="name">Leaves Approval</field>
<field name="icon">fa-sun-o</field>
<field name="res_model_id" ref="hr_holidays.model_hr_leave"/>
</record>
<record id="mail_act_leave_second_approval" model="mail.activity.type">
<field name="name">Leaves Second Approve</field>
<field name="icon">fa-sun-o</field>
<field name="res_model_id" ref="hr_holidays.model_hr_leave"/>
</record>
<!-- Leave specific activities -->
<record id="mail_act_leave_allocation_approval" model="mail.activity.type">
<field name="name">Allocation Approval</field>
<field name="icon">fa-sun-o</field>
<field name="res_model_id" ref="hr_holidays.model_hr_leave_allocation"/>
</record>
<record id="mail_act_leave_allocation_second_approval" model="mail.activity.type">
<field name="name">Allocation Second Approve</field>
<field name="icon">fa-sun-o</field>
<field name="res_model_id" ref="hr_holidays.model_hr_leave_allocation"/>
</record>
<!-- Holidays-related subtypes for messaging / Chatter -->
<record id="mt_leave_approved" model="mail.message.subtype">
<field name="name">Approved</field>
<field name="res_model">hr.leave</field>
<field name="description">Request approved</field>
</record>
<record id="mt_leave_refused" model="mail.message.subtype">
<field name="name">Refused</field>
<field name="res_model">hr.leave</field>
<field name="default" eval="False"/>
<field name="description">Request refused</field>
</record>
<!-- Allocation-related subtypes for messaging / Chatter -->
<record id="mt_leave_allocation_approved" model="mail.message.subtype">
<field name="name">Approved</field>
<field name="res_model">hr.leave.allocation</field>
<field name="description">Request approved</field>
</record>
<record id="mt_leave_allocation_refused" model="mail.message.subtype">
<field name="name">Refused</field>
<field name="res_model">hr.leave.allocation</field>
<field name="default" eval="False"/>
<field name="description">Request refused</field>
</record>
<!-- Department related subtypes for messaging / Chatter -->
<record id="mt_department_leave_approved" model="mail.message.subtype">
<field name="name">Leaves Approved</field>
<field name="res_model">hr.department</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_leave_approved')"/>
<field name="relation_field">department_id</field>
<field name="sequence" eval="8"/>
</record>
<record id="mt_department_leave_refused" model="mail.message.subtype">
<field name="name">Leaves Refused</field>
<field name="res_model">hr.department</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_leave_refused')"/>
<field name="relation_field">department_id</field>
<field name="sequence" eval="9"/>
</record>
<record id="mt_department_leave_allocation_approved" model="mail.message.subtype">
<field name="name">Allocation Approved</field>
<field name="res_model">hr.department</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_leave_allocation_approved')"/>
<field name="relation_field">department_id</field>
<field name="sequence" eval="8"/>
</record>
<record id="mt_department_leave_allocation_refused" model="mail.message.subtype">
<field name="name">Allocation Refused</field>
<field name="res_model">hr.department</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_leave_allocation_refused')"/>
<field name="relation_field">department_id</field>
<field name="sequence" eval="9"/>
</record>
</data>
</odoo>