From 7cd00c0702afbbd1d25674633f36a8179a162c1e Mon Sep 17 00:00:00 2001 From: Rob Coekaerts Date: Wed, 8 Feb 2023 15:19:23 +0000 Subject: [PATCH] [IMP] hr: simplify and correct the default data Some changes were made to the default/demo/test data to be more consistent: - Duplicates of "Paid Time Off" time off types are consolidated into one type (inluding year specific versions, ig "Paid Time Off 2019" - Annual Time Off is renamed back to Paid Time Off (both for the work entry type as the time off type) to be consistent everywhere. - All mentions of years in work entry types and time off types have been removed, as this is no longer relevant with the new allocation rules. - Time off types in the default data have been explicitely made company agnostic, in order for them to be available to all companies and not just the one company that was select when installing hr_holidays. This was already the case for the be_payroll data, but not for the standard hr_holidays ones. - Various small cosmetic / functional fixes and simplifications (eg deduplication of data) - expense_other_input has been made country agnostic, in order for it to be available in all countries. task-2978513 closes odoo/odoo#112208 X-original-commit: dcc8bbf Related: odoo/enterprise#36819 Signed-off-by: Kevin Baptiste --- addons/hr_holidays/data/hr_holidays_data.xml | 10 +++++++- addons/hr_holidays/data/hr_holidays_demo.xml | 23 +++++++++++++++++++ .../hr_holidays/tests/test_access_rights.py | 6 ++--- .../data/hr_holidays_attendance_data.xml | 1 + .../data/hr_work_entry_data.xml | 2 +- addons/hr_work_entry_holidays/__manifest__.py | 1 + .../data/hr_payroll_holidays_demo.xml | 8 ------- addons/resource/data/resource_data.xml | 3 ++- 8 files changed, 40 insertions(+), 14 deletions(-) diff --git a/addons/hr_holidays/data/hr_holidays_data.xml b/addons/hr_holidays/data/hr_holidays_data.xml index 4dca005bc63..bc4e1065d33 100644 --- a/addons/hr_holidays/data/hr_holidays_data.xml +++ b/addons/hr_holidays/data/hr_holidays_data.xml @@ -263,6 +263,8 @@ 2 + + 1 @@ -272,8 +274,10 @@ True - + 3 + + 2 @@ -288,6 +292,8 @@ 4 + + 4 @@ -302,6 +308,8 @@ 5 + + 3 diff --git a/addons/hr_holidays/data/hr_holidays_demo.xml b/addons/hr_holidays/data/hr_holidays_demo.xml index fbb236edbf5..b13de138ef8 100644 --- a/addons/hr_holidays/data/hr_holidays_demo.xml +++ b/addons/hr_holidays/data/hr_holidays_demo.xml @@ -14,6 +14,7 @@ both officer + @@ -23,6 +24,7 @@ both officer + @@ -258,7 +260,11 @@ + confirm + + + @@ -381,6 +387,9 @@ confirm + + + Doctor Appointment @@ -433,6 +442,9 @@ confirm + + + Second dentist appointment @@ -445,6 +457,9 @@ confirm + + + @@ -455,5 +470,13 @@ + + + Company Celebration + + + + 9 + diff --git a/addons/hr_holidays/tests/test_access_rights.py b/addons/hr_holidays/tests/test_access_rights.py index 13dbab91b32..7db64df1838 100644 --- a/addons/hr_holidays/tests/test_access_rights.py +++ b/addons/hr_holidays/tests/test_access_rights.py @@ -730,7 +730,7 @@ class TestAccessRightsUnlink(TestHrHolidaysAccessRightsCommon): 'holiday_status_id': self.leave_type.id, 'state': 'draft', } - leave = self.request_leave(self.user_employee_id, datetime.now() + relativedelta(days=6), 1, values) + leave = self.request_leave(self.user_employee_id, datetime.now() + relativedelta(days=5), 1, values) leave.with_user(self.user_employee.id).unlink() def test_leave_unlink_confirm_by_user(self): @@ -741,7 +741,7 @@ class TestAccessRightsUnlink(TestHrHolidaysAccessRightsCommon): 'holiday_status_id': self.leave_type.id, 'state': 'confirm', } - leave = self.request_leave(self.user_employee_id, datetime.now() + relativedelta(days=6), 1, values) + leave = self.request_leave(self.user_employee_id, datetime.now() + relativedelta(days=5), 1, values) leave.with_user(self.user_employee.id).unlink() def test_leave_unlink_confirm_in_past_by_user(self): @@ -763,7 +763,7 @@ class TestAccessRightsUnlink(TestHrHolidaysAccessRightsCommon): 'employee_id': self.employee_emp.id, 'holiday_status_id': self.leave_type.id, } - leave = self.request_leave(self.user_employee_id, datetime.now() + relativedelta(days=6), 1, values) + leave = self.request_leave(self.user_employee_id, datetime.now() + relativedelta(days=5), 1, values) leave.with_user(self.user_hrmanager_id).write({'state': 'validate'}) with self.assertRaises(UserError), self.cr.savepoint(): leave.with_user(self.user_employee.id).unlink() diff --git a/addons/hr_holidays_attendance/data/hr_holidays_attendance_data.xml b/addons/hr_holidays_attendance/data/hr_holidays_attendance_data.xml index 2a8c919949d..b97df463842 100644 --- a/addons/hr_holidays_attendance/data/hr_holidays_attendance_data.xml +++ b/addons/hr_holidays_attendance/data/hr_holidays_attendance_data.xml @@ -10,6 +10,7 @@ + 5 diff --git a/addons/hr_work_entry_contract/data/hr_work_entry_data.xml b/addons/hr_work_entry_contract/data/hr_work_entry_data.xml index 7a88bfee61f..4674eaa2422 100644 --- a/addons/hr_work_entry_contract/data/hr_work_entry_data.xml +++ b/addons/hr_work_entry_contract/data/hr_work_entry_data.xml @@ -39,7 +39,7 @@ - + Paid Time Off LEAVE120 True 5 diff --git a/addons/hr_work_entry_holidays/__manifest__.py b/addons/hr_work_entry_holidays/__manifest__.py index 70b5c8d69a7..f6b68aa7164 100644 --- a/addons/hr_work_entry_holidays/__manifest__.py +++ b/addons/hr_work_entry_holidays/__manifest__.py @@ -16,6 +16,7 @@ This application allows you to integrate time off in payslips. """, 'depends': ['hr_holidays', 'hr_work_entry_contract'], 'data': [ + 'data/hr_payroll_holidays_data.xml', 'views/hr_leave_views.xml', 'views/hr_leave_type_views.xml', ], diff --git a/addons/hr_work_entry_holidays/data/hr_payroll_holidays_demo.xml b/addons/hr_work_entry_holidays/data/hr_payroll_holidays_demo.xml index 741c4707263..54768182651 100644 --- a/addons/hr_work_entry_holidays/data/hr_payroll_holidays_demo.xml +++ b/addons/hr_work_entry_holidays/data/hr_payroll_holidays_demo.xml @@ -1,14 +1,6 @@ - - - - - - - - diff --git a/addons/resource/data/resource_data.xml b/addons/resource/data/resource_data.xml index 94d7dddaff2..54ab1ec1e26 100644 --- a/addons/resource/data/resource_data.xml +++ b/addons/resource/data/resource_data.xml @@ -47,7 +47,8 @@ Standard 38 hours/week - + + 7.6