From 133fd0a21e7de2f5f64e3d337c6a427e249576ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 29 Nov 2017 15:09:28 +0100 Subject: [PATCH] [IMP] hr_expense: improve activity management on expense sheet model This commit improves expense flow management through a better integration of activities and addition of automated activities. Several things are done in this commit : * expense sheet (report) model do not inherit from mail.activity.mixin. This commit adds the inherit so that expense users and managers can now schedule and manage activities on expense reports. This will help them in their daily job; * automatic activities generation is added for expense reports. Activities are generated for 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 expense reports to approve. This commit therefore * simplifies the tracking as tracking to confirm reports is not necessary anymore; * removes to approve subtype on report model as well as its parent subtype on the department. This allows to simplify chatter in hr_expense app; --- addons/hr_expense/__manifest__.py | 1 + addons/hr_expense/data/mail_data.xml | 23 +++++---------- addons/hr_expense/models/hr_expense.py | 29 ++++++++++++++++--- .../hr_expense/security/ir.model.access.csv | 2 +- addons/hr_expense/views/hr_expense_views.xml | 19 ++++++++++++ .../hr_expense/views/mail_activity_views.xml | 16 ++++++++++ 6 files changed, 69 insertions(+), 21 deletions(-) create mode 100644 addons/hr_expense/views/mail_activity_views.xml diff --git a/addons/hr_expense/__manifest__.py b/addons/hr_expense/__manifest__.py index 09096c0ec21..11ae6223152 100644 --- a/addons/hr_expense/__manifest__.py +++ b/addons/hr_expense/__manifest__.py @@ -36,6 +36,7 @@ This module also uses analytic accounting and is compatible with the invoice on 'wizard/hr_expense_refuse_reason_views.xml', 'wizard/hr_expense_sheet_register_payment.xml', 'views/hr_expense_views.xml', + 'views/mail_activity_views.xml', 'security/ir_rule.xml', 'report/hr_expense_report.xml', 'views/hr_department_views.xml', diff --git a/addons/hr_expense/data/mail_data.xml b/addons/hr_expense/data/mail_data.xml index be825bac3db..02d662ecff5 100644 --- a/addons/hr_expense/data/mail_data.xml +++ b/addons/hr_expense/data/mail_data.xml @@ -2,7 +2,13 @@ - + + Expense Approval + fa-dollar + + + + expense @@ -23,27 +29,12 @@ Expense report refused - - Submitted - hr.expense.sheet - Expense report submitted, waiting approval - - Paid hr.expense.sheet Expense report paid - - - Expenses To Approve - hr.department - - - department_id - -