diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index 4b653444f20ec6..a1db702a32f0e8 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -617,8 +617,7 @@ def _compute_legal_name(self): @api.depends('current_version_id') @api.depends_context('version_id') def _compute_version_id(self): - context_version_id = self.env.context.get('version_id', False) - context_version = self.env['hr.version'].browse(context_version_id).exists() if context_version_id else self.env['hr.version'] + context_version = self.env['hr.version'].browse(self.env.context.get('version_id', False)) for employee in self: if context_version.employee_id == self: diff --git a/addons/hr/static/src/components/button_new_contract/button_new_contract.xml b/addons/hr/static/src/components/button_new_contract/button_new_contract.xml index cdcdbcebea5d0b..0c640d5b88d4c4 100644 --- a/addons/hr/static/src/components/button_new_contract/button_new_contract.xml +++ b/addons/hr/static/src/components/button_new_contract/button_new_contract.xml @@ -2,8 +2,8 @@ - New Contract + New Contract diff --git a/addons/hr/tests/test_hr_version.py b/addons/hr/tests/test_hr_version.py index 239ce9c4c22fc5..21db61e7e216df 100644 --- a/addons/hr/tests/test_hr_version.py +++ b/addons/hr/tests/test_hr_version.py @@ -523,27 +523,6 @@ def test_multi_edit_other_and_contract_date_sync(self): self.assertEqual(version.job_id.id, jobB.id) self.assertEqual(version.contract_date_end, date(2020, 9, 30)) - def test_delete_version(self): - employee = self.env['hr.employee'].create({ - 'name': 'John Doe', - 'date_version': '2020-01-01', - }) - v1 = employee.version_id - v2 = employee.create_version({ - 'date_version': '2021-01-01', - }) - v3 = employee.create_version({ - 'date_version': '2022-01-01', - }) - self.assertEqual(employee.current_version_id, v3) - - v3.unlink() - self.assertEqual(employee.current_version_id, v2) - v1.unlink() - self.assertEqual(employee.current_version_id, v2) - with self.assertRaises(ValidationError): - v2.unlink() - def test_multi_edit_multi_employees_no_contract(self): """ Test the multi-edit when there is one version per employee, without contract diff --git a/addons/hr/views/hr_employee_views.xml b/addons/hr/views/hr_employee_views.xml index aeda9df6da40d0..2215f75de30389 100644 --- a/addons/hr/views/hr_employee_views.xml +++ b/addons/hr/views/hr_employee_views.xml @@ -375,7 +375,7 @@ to - + diff --git a/addons/hr_holidays/static/src/components/accrual_level/accrual_levels.scss b/addons/hr_holidays/static/src/components/accrual_level/accrual_levels.scss index 9cec634e1b2dd5..5ea81942c9be6c 100644 --- a/addons/hr_holidays/static/src/components/accrual_level/accrual_levels.scss +++ b/addons/hr_holidays/static/src/components/accrual_level/accrual_levels.scss @@ -10,7 +10,7 @@ } .o_accrual { - .o_field_accrual, .o_field_selection, .o_field_day_selection, .o_field_filterable_selection { + .o_field_accrual, .o_field_selection, .o_field_filterable_selection { width: fit-content !important; &:not(.o_readonly_modifier) > *:first-child { @@ -20,7 +20,7 @@ field-sizing: content; } - &:not(.o_field_selection, .o_field_day_selection, .o_field_filterable_selection) > *:first-child { + &:not(.o_field_selection, .o_field_filterable_selection) > *:first-child { max-width: 8ch; } } diff --git a/addons/hr_holidays/static/src/components/day_selection/day_selection.js b/addons/hr_holidays/static/src/components/day_selection/day_selection.js deleted file mode 100644 index 05288069a543bc..00000000000000 --- a/addons/hr_holidays/static/src/components/day_selection/day_selection.js +++ /dev/null @@ -1,41 +0,0 @@ -import { registry } from "@web/core/registry"; -import { SelectionField, selectionField } from "@web/views/fields/selection/selection_field"; - -export class DaySelectionField extends SelectionField { - static props = { - ...SelectionField.props, - monthField: String, - }; - /** - * @override - * return the available days in the carryover_month - * e.g. February -> [1, 29], april -> [1, 30] - */ - get options() { - let options = super.options; - const carryover_month = this.props.record.data[this.props.monthField]; - // lastDay is the last day of the current_month for the leap year 2020 - const lastDay = new Date(2020, carryover_month, 0).getDate(); - options = options.filter((option) => option[0] <= lastDay); - return options; - } -} - -export const daySelectionField = { - ...selectionField, - component: DaySelectionField, - extractProps({ attrs }) { - return { - ...selectionField.extractProps(...arguments), - monthField: attrs.month_field, - }; - }, - fieldDependencies: ({ attrs }) => [ - { - name: attrs.month_field, - type: "selection", - }, - ], -}; - -registry.category("fields").add("day_selection", daySelectionField); diff --git a/addons/hr_holidays/views/hr_leave_accrual_views.xml b/addons/hr_holidays/views/hr_leave_accrual_views.xml index fedc5058fa94d4..a097fdbec8f74b 100644 --- a/addons/hr_holidays/views/hr_leave_accrual_views.xml +++ b/addons/hr_holidays/views/hr_leave_accrual_views.xml @@ -36,17 +36,17 @@ on the - + of and the - + of on the - + of @@ -195,7 +195,7 @@ options="{'links': {'other': 'carryover_custom_date'}, 'observe': 'carryover'}"/> : the - of = '%(date)s') AND s.valid_from <= '%(date)s' AS active + FROM hr_employee e + LEFT JOIN hr_version v ON e.current_version_id = v.id + LEFT OUTER JOIN hr_employee_skill s ON e.id = s.employee_id + LEFT OUTER JOIN hr_skill_level sl ON sl.id = s.skill_level_id + LEFT OUTER JOIN hr_skill_type st ON st.id = sl.skill_type_id + WHERE e.active AND st.active IS True AND st.is_certification IS TRUE + ) + """ % { + 'table': self._table, + 'date': fields.Date.context_today(self) + }) diff --git a/addons/hr_skills/report/hr_employee_certification_report_views.xml b/addons/hr_skills/report/hr_employee_certification_report_views.xml new file mode 100644 index 00000000000000..079ef1f790fd91 --- /dev/null +++ b/addons/hr_skills/report/hr_employee_certification_report_views.xml @@ -0,0 +1,71 @@ + + + + hr.employee.certification.report + + + + + + + + + + + + hr.employee.certification.report + + + + + + + + + + + + + hr.employee.certification.report + + + + + + + + + + + + + + + + + + + + Certification + hr.employee.certification.report + + list,pivot + { + 'search_default_employee': 1, + } + + + + This report will give you an overview of the certification per Employee. + Create them in configuration and add them on the Employee. + + + + + + diff --git a/addons/hr_skills/report/hr_employee_skill_report_views.xml b/addons/hr_skills/report/hr_employee_skill_report_views.xml index 86b997da5ffbbe..bddca497eb6efa 100644 --- a/addons/hr_skills/report/hr_employee_skill_report_views.xml +++ b/addons/hr_skills/report/hr_employee_skill_report_views.xml @@ -89,6 +89,6 @@ id="hr_employee_skill_inventory_report_menu" name="Skills Inventory" action="hr_employee_skill_report_action" - parent="hr.hr_menu_hr_reports" + parent="hr_skills.hr_employee_skill_report_menu" sequence="15"/> diff --git a/addons/hr_skills/views/hr_views.xml b/addons/hr_skills/views/hr_views.xml index 582a73545e85cb..30c25016ea019d 100644 --- a/addons/hr_skills/views/hr_views.xml +++ b/addons/hr_skills/views/hr_views.xml @@ -589,7 +589,7 @@ hr.employee.skill certifications [('is_certification', '=', True), ('company_id', 'in', allowed_company_ids)] - {'show_employee': True} + {'show_employee': True, 'search_default_group_by_type': 1} list,form + +
+
+ This report will give you an overview of the certification per Employee. + Create them in configuration and add them on the Employee. +