diff --git a/project_timesheet_holidays_type/__init__.py b/project_timesheet_holidays_type/__init__.py new file mode 100644 index 0000000..9a7e03e --- /dev/null +++ b/project_timesheet_holidays_type/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/project_timesheet_holidays_type/__manifest__.py b/project_timesheet_holidays_type/__manifest__.py new file mode 100644 index 0000000..4e184e5 --- /dev/null +++ b/project_timesheet_holidays_type/__manifest__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +{ + 'name': "project timesheet holidays type", + 'version': '16.0.1.0.0', + 'depends': ['project_timesheet_holidays'], + 'author': "Élabore", + 'category': 'Human Resources/Employees', + 'summary' : "add holidays type in project timesheet holidays type description", + 'description': """ + In project timesheet holidays, all holidays types are name 'Times off (d/d)' in description. + This module changes 'Times off' by the holiday type for better description. + """, + 'data': [ + ], + 'demo': [ + ], + 'application': False, + 'license': 'LGPL-3', +} \ No newline at end of file diff --git a/project_timesheet_holidays_type/models/__init__.py b/project_timesheet_holidays_type/models/__init__.py new file mode 100644 index 0000000..00e4189 --- /dev/null +++ b/project_timesheet_holidays_type/models/__init__.py @@ -0,0 +1 @@ +from . import hr_holidays \ No newline at end of file diff --git a/project_timesheet_holidays_type/models/hr_holidays.py b/project_timesheet_holidays_type/models/hr_holidays.py new file mode 100644 index 0000000..c2068e5 --- /dev/null +++ b/project_timesheet_holidays_type/models/hr_holidays.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, _ + +class Holidays(models.Model): + _inherit = "hr.leave" + + def _timesheet_prepare_line_values(self, index, work_hours_data, day_date, work_hours_count): + res = super()._timesheet_prepare_line_values(index, work_hours_data, day_date, work_hours_count) + res['name'] = _("%s (%s/%s)",self.holiday_status_id.name, index + 1, len(work_hours_data)) + return res