diff options
| author | Thibault Delavallée <tde@odoo.com> | 2017-11-17 13:54:02 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2018-03-27 15:19:10 +0200 |
| commit | 1d71c0623334706abde82b45fd6fcef2b35ba9f9 (patch) | |
| tree | a09884e45919cbf1092aeb3727a48655ea1069f9 /addons/hr_holidays/data/mail_data.xml | |
| parent | 78c4d936e56608fe76d271aa3eca0f3a82888777 (diff) | |
[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;
Diffstat (limited to 'addons/hr_holidays/data/mail_data.xml')
| -rw-r--r-- | addons/hr_holidays/data/mail_data.xml | 86 |
1 files changed, 21 insertions, 65 deletions
diff --git a/addons/hr_holidays/data/mail_data.xml b/addons/hr_holidays/data/mail_data.xml index 57c92f06581..2dc75bcb8c8 100644 --- a/addons/hr_holidays/data/mail_data.xml +++ b/addons/hr_holidays/data/mail_data.xml @@ -1,26 +1,36 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> <data noupdate="1"> - <!-- Holidays-related subtypes for messaging / Chatter --> - <record id="mt_leave_confirmed" model="mail.message.subtype"> - <field name="name">Confirmed</field> - <field name="res_model">hr.leave</field> - <field name="description">Request created and waiting confirmation</field> + <!-- 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> - <record id="mt_leave_first_validated" model="mail.message.subtype"> - <field name="name">Waiting Second Validation</field> - <field name="res_model">hr.leave</field> - <field name="default" eval="False"/> - <field name="description">Request validated, waiting second validation</field> + <!-- 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> @@ -29,25 +39,11 @@ </record> <!-- Allocation-related subtypes for messaging / Chatter --> - <record id="mt_leave_allocation_confirmed" model="mail.message.subtype"> - <field name="name">Confirmed</field> - <field name="res_model">hr.leave.allocation</field> - <field name="description">Request created and waiting confirmation</field> - </record> - - <record id="mt_leave_allocation_first_validated" model="mail.message.subtype"> - <field name="name">Waiting Second Validation</field> - <field name="res_model">hr.leave.allocation</field> - <field name="default" eval="False"/> - <field name="description">Request validated, waiting second validation</field> - </record> - <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> @@ -56,24 +52,6 @@ </record> <!-- Department related subtypes for messaging / Chatter --> - <record id="mt_department_leave_confirmed" model="mail.message.subtype"> - <field name="name">Leaves Confirmed</field> - <field name="res_model">hr.department</field> - <field name="default" eval="True"/> - <field name="parent_id" eval="ref('mt_leave_confirmed')"/> - <field name="relation_field">department_id</field> - <field name="sequence" eval="6"/> - </record> - - <record id="mt_department_leave_first_validated" model="mail.message.subtype"> - <field name="name">Leaves First Approval</field> - <field name="res_model">hr.department</field> - <field name="default" eval="False"/> - <field name="parent_id" eval="ref('mt_leave_first_validated')"/> - <field name="relation_field">department_id</field> - <field name="sequence" eval="7"/> - </record> - <record id="mt_department_leave_approved" model="mail.message.subtype"> <field name="name">Leaves Approved</field> <field name="res_model">hr.department</field> @@ -82,7 +60,6 @@ <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> @@ -91,25 +68,6 @@ <field name="relation_field">department_id</field> <field name="sequence" eval="9"/> </record> - - <record id="mt_department_leave_allocation_confirmed" model="mail.message.subtype"> - <field name="name">Allocations Confirmed</field> - <field name="res_model">hr.department</field> - <field name="default" eval="True"/> - <field name="parent_id" eval="ref('mt_leave_allocation_confirmed')"/> - <field name="relation_field">department_id</field> - <field name="sequence" eval="6"/> - </record> - - <record id="mt_department_leave_allocation_first_validated" model="mail.message.subtype"> - <field name="name">Allocations First Approval</field> - <field name="res_model">hr.department</field> - <field name="default" eval="False"/> - <field name="parent_id" eval="ref('mt_leave_allocation_first_validated')"/> - <field name="relation_field">department_id</field> - <field name="sequence" eval="7"/> - </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> @@ -118,7 +76,6 @@ <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> @@ -127,6 +84,5 @@ <field name="relation_field">department_id</field> <field name="sequence" eval="9"/> </record> - </data> </odoo>
\ No newline at end of file |
