From d781c220e6e6701f40252213976d6d24bf245c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Mil=C3=A9o?= Date: Wed, 27 Nov 2024 20:18:53 -0300 Subject: [PATCH] [REF] overtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luis Felipe Miléo --- .../README.rst | 34 +--- .../__manifest__.py | 7 +- .../models/__init__.py | 3 +- .../models/hr_attendance.py | 165 ++++++++++-------- .../models/hr_attendance_exception.py | 42 +++++ .../models/hr_attendance_overtime.py | 107 +++++++++++- .../models/hr_overtime_multiplier_range.py | 103 +++++++++++ .../models/res_config_settings.py | 22 --- .../security/hr_attendance_exception.xml | 22 +++ .../security/hr_overtime_multiplier_range.xml | 22 +++ .../static/description/index.html | 24 +-- .../views/hr_attendance_exception.xml | 60 +++++++ .../views/hr_attendance_overtime.xml | 104 ++++++++++- .../views/hr_overtime_multiplier_range.xml | 74 ++++++++ .../views/res_config_settings.xml | 48 ----- 15 files changed, 637 insertions(+), 200 deletions(-) create mode 100644 l10n_br_hr_overtime_custom_multiplier/models/hr_attendance_exception.py create mode 100644 l10n_br_hr_overtime_custom_multiplier/models/hr_overtime_multiplier_range.py delete mode 100644 l10n_br_hr_overtime_custom_multiplier/models/res_config_settings.py create mode 100644 l10n_br_hr_overtime_custom_multiplier/security/hr_attendance_exception.xml create mode 100644 l10n_br_hr_overtime_custom_multiplier/security/hr_overtime_multiplier_range.xml create mode 100644 l10n_br_hr_overtime_custom_multiplier/views/hr_attendance_exception.xml create mode 100644 l10n_br_hr_overtime_custom_multiplier/views/hr_overtime_multiplier_range.xml delete mode 100644 l10n_br_hr_overtime_custom_multiplier/views/res_config_settings.xml diff --git a/l10n_br_hr_overtime_custom_multiplier/README.rst b/l10n_br_hr_overtime_custom_multiplier/README.rst index 5d5ceaf..b00a42c 100644 --- a/l10n_br_hr_overtime_custom_multiplier/README.rst +++ b/l10n_br_hr_overtime_custom_multiplier/README.rst @@ -16,17 +16,11 @@ L10n Br Hr Overtime Custom Multiplier .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fkmee--odoo--addons-lightgray.png?logo=github - :target: https://github.com/OCA/kmee-odoo-addons/tree/16.0/l10n_br_hr_overtime_custom_multiplier - :alt: OCA/kmee-odoo-addons -.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/kmee-odoo-addons-16-0/kmee-odoo-addons-16-0-l10n_br_hr_overtime_custom_multiplier - :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/kmee-odoo-addons&target_branch=16.0 - :alt: Try me on Runboat - -|badge1| |badge2| |badge3| |badge4| |badge5| +.. |badge3| image:: https://img.shields.io/badge/github-KMEE%2Fkmee--odoo--addons-lightgray.png?logo=github + :target: https://github.com/KMEE/kmee-odoo-addons/tree/16.0/l10n_br_hr_overtime_custom_multiplier + :alt: KMEE/kmee-odoo-addons + +|badge1| |badge2| |badge3| Module allows companies to apply a custom multiplier to overtime calculations in the Brazilian localization, providing flexible and @@ -40,10 +34,10 @@ configurable overtime management. Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -65,16 +59,6 @@ Contributors Maintainers ----------- -This module is maintained by the OCA. - -.. image:: https://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: https://odoo-community.org - -OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use. - -This module is part of the `OCA/kmee-odoo-addons `_ project on GitHub. +This module is part of the `KMEE/kmee-odoo-addons `_ project on GitHub. -You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. +You are welcome to contribute. diff --git a/l10n_br_hr_overtime_custom_multiplier/__manifest__.py b/l10n_br_hr_overtime_custom_multiplier/__manifest__.py index 4eab6f5..70325c2 100644 --- a/l10n_br_hr_overtime_custom_multiplier/__manifest__.py +++ b/l10n_br_hr_overtime_custom_multiplier/__manifest__.py @@ -12,8 +12,11 @@ "l10n_br_resource", ], "data": [ + "security/hr_attendance_exception.xml", + "security/hr_overtime_multiplier_range.xml", + # "views/hr_attendance_overtime.xml", - "views/res_config_settings.xml", + "views/hr_overtime_multiplier_range.xml", + "views/hr_attendance_exception.xml", ], - "demo": [], } diff --git a/l10n_br_hr_overtime_custom_multiplier/models/__init__.py b/l10n_br_hr_overtime_custom_multiplier/models/__init__.py index 17b37b3..9981f3d 100644 --- a/l10n_br_hr_overtime_custom_multiplier/models/__init__.py +++ b/l10n_br_hr_overtime_custom_multiplier/models/__init__.py @@ -1,3 +1,4 @@ from . import hr_attendance -from . import res_config_settings from . import hr_attendance_overtime +from . import hr_overtime_multiplier_range +from . import hr_attendance_exception diff --git a/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance.py b/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance.py index 9d682ad..1724ec0 100644 --- a/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance.py +++ b/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance.py @@ -5,85 +5,98 @@ class HrAttendance(models.Model): - _inherit = "hr.attendance" @api.model def _update_overtime(self, employee_attendance_dates=None): - res = super(HrAttendance, self)._update_overtime(employee_attendance_dates) - - def get_overtime_multiplier_and_bank_time( - date_time, original_overtime, is_holiday=False - ): - - config_params = self.env["ir.config_parameter"].sudo() - - # Get the day of the week (0=Monday, 6=Sunday) - day_of_week = date_time.weekday() - - # Check if it is a holiday - if is_holiday: - return float( - config_params.get_param("sunday_holidays_overtime_multiplier", 1) - ) - - # Saturdays (day 5) - if day_of_week == 5: - return float(config_params.get_param("saturday_overtime_multiplier", 1)) - - # Sundays (day 6) - if day_of_week == 6: - return float( - config_params.get_param("sunday_holidays_overtime_multiplier", 1) - ) - - # For weekdays (Monday to Friday) - if original_overtime < 2: # Less than 2 hours of overtime - return float( - config_params.get_param( - "business_days_under_2_hours_overtime_multiplier", 1 - ) - ) - else: # More than 2 hours of overtime - return float( - config_params.get_param( - "business_days_over_2_hours_overtime_multiplier", 1 - ) - ) - - if employee_attendance_dates is None: - employee_attendance_dates = self._get_attendances_dates() - - self.env["hr.attendance.overtime"].flush_model(["duration", "duration_real"]) - - for emp, attendance_dates in employee_attendance_dates.items(): - for day_data in attendance_dates: - attendance_date = day_data[1] - overtime = self.env["hr.attendance.overtime"].search( - [ - ("employee_id", "=", emp.id), - ("date", "=", attendance_date), - ("adjustment", "=", False), - ] - ) - - is_holiday = emp.resource_calendar_id.data_eh_feriado(attendance_date) - - if overtime: - for overtime_record in overtime: - overtime_multiplier = get_overtime_multiplier_and_bank_time( - attendance_date, overtime_record.duration, is_holiday - ) - - overtime_record.write( - { - "duration": overtime_record.duration - * overtime_multiplier, - "duration_real": overtime_record.duration_real - * overtime_multiplier, - "extra_hours_withou_multiplier": overtime_record.duration, - "applied_multiplier": overtime_multiplier, - } - ) + self.env["hr.attendance.overtime"].search( + [("attendance_id", "in", self.ids)] + ).unlink() + res = super( + HrAttendance, self.with_context(attendance_ids=self.ids) + )._update_overtime(employee_attendance_dates) return res + + +# def get_overtime_multiplier(date_time, +# original_overtime, is_holiday=False, employee_id=None): +# # Check if there is an exception +# for this employee on this date +# exception = self.env['hr.attendance.exception'].search([ +# ('employee_id', '=', employee_id), +# ('date', '=', date_time.date()) +# ], limit=1) + +# if exception: +# day_of_week = exception.day_of_week_override +# else: +# day_of_week = 'holiday' if is_holiday else ( +# 'monday' if date_time.weekday() == 0 else +# 'tuesday' if date_time.weekday() == 1 else +# 'wednesday' if date_time.weekday() == 2 else +# 'thursday' if date_time.weekday() == 3 else +# 'friday' if date_time.weekday() == 4 else +# 'saturday' if date_time.weekday() == 5 else +# 'sunday' if date_time.weekday() == 6 else 'weekday') + +# # Search for applicable multiplier range +# applicable_range = self.env['hr.overtime.multiplier.range'].search([ +# ('overtime_from', '<=', original_overtime), +# ('overtime_to', '>', original_overtime), +# # "|", + +# # ('monday', '=', day_of_week == 'monday'), +# # ('tuesday', '=', day_of_week == 'tuesday'), +# # ('wednesday', '=', day_of_week == 'wednesday'), +# # ('thursday', '=', day_of_week == 'thursday'), +# # ('friday', '=', day_of_week == 'friday'), +# # ('saturday', '=', day_of_week == 'saturday'), +# # ('sunday', '=', day_of_week == 'sunday'), +# # ('holiday', '=', day_of_week == 'holiday'), +# ], limit=1) + +# return applicable_range.multiplier if applicable_range else 1.0 + +# if employee_attendance_dates is None: +# employee_attendance_dates = self._get_attendances_dates() + +# self.env["hr.attendance.overtime"].flush_model(["duration", "duration_real"]) + +# for emp, attendance_dates in employee_attendance_dates.items(): +# for day_data in attendance_dates: +# attendance_date = day_data[1] +# overtime = self.env["hr.attendance.overtime"].search( +# [ +# ("employee_id", "=", emp.id), +# ("date", "=", attendance_date), +# ("adjustment", "=", False), +# ] +# ) + +# # Convert attendance_date to a datetime object if it is a date object +# if isinstance(attendance_date, date) +# and not isinstance(attendance_date, datetime): +# attendance_date = datetime.combine(attendance_date, datetime.min.time()) + +# is_holiday = emp.resource_calendar_id.data_eh_feriado(attendance_date) + +# if overtime: +# for overtime_record in overtime: +# overtime_multiplier = get_overtime_multiplier( +# attendance_date, overtime_record.duration, is_holiday, emp.id +# ) + +# overtime_record.write( +# { +# "duration": +# overtime_record.duration * overtime_multiplier, +# "duration_real": +# overtime_record.duration_real * overtime_multiplier, +# "extra_hours_withou_multiplier": +# overtime_record.duration, +# "applied_multiplier": overtime_multiplier, +# } +# ) + +# return res diff --git a/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance_exception.py b/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance_exception.py new file mode 100644 index 0000000..9182549 --- /dev/null +++ b/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance_exception.py @@ -0,0 +1,42 @@ +# Copyright 2024 KMEE +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class HrAttendanceException(models.Model): + _name = "hr.attendance.exception" + _description = "Attendance Exception" + + employee_id = fields.Many2one("hr.employee", string="Employee", required=True) + date = fields.Date(required=True) + day_of_week_override = fields.Selection( + [ + ("monday", "Monday"), + ("tuesday", "Tuesday"), + ("wednesday", "Wednesday"), + ("thursday", "Thursday"), + ("friday", "Friday"), + ("saturday", "Saturday"), + ("sunday", "Sunday"), + ("holiday", "Holiday"), + ], + string="Override Day of the Week", + required=True, + ) + + @api.constrains("employee_id", "date") + def _check_duplicate_exception(self): + for record in self: + duplicate_exception = self.search( + [ + ("employee_id", "=", record.employee_id.id), + ("date", "=", record.date), + ("id", "!=", record.id), + ] + ) + if duplicate_exception: + raise ValidationError( + _("An exception already exists for this employee on this date.") + ) diff --git a/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance_overtime.py b/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance_overtime.py index 16fbe87..6270824 100644 --- a/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance_overtime.py +++ b/l10n_br_hr_overtime_custom_multiplier/models/hr_attendance_overtime.py @@ -1,15 +1,114 @@ # Copyright 2024 KMEE # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import fields, models +from odoo import api, fields, models class HrAttendanceOvertime(models.Model): _inherit = "hr.attendance.overtime" - extra_hours_withou_multiplier = fields.Float( - string="Extra Hours without Multiplier" + extra_hours_without_multiplier = fields.Float( + string="Extra Hours without Multiplier", readonly="1" ) - applied_multiplier = fields.Float(default=1.0) + applied_multiplier = fields.Float(default=1.0, readonly="1") + + adjustment_overtime_id = fields.Many2one( + "hr.attendance.overtime", readonly="1", ondelete="cascade" + ) + attendance_id = fields.Many2one("hr.attendance", readonly="1", ondelete="cascade") + + overtime_range_id = fields.Many2one( + "hr.overtime.multiplier.range", string="Multiplier", readonly=True + ) + + def _prepare_overtime_multiplier_ajustements(self): + for record in self: + overtime_ranges = self.env[ + "hr.overtime.multiplier.range" + ]._search_overtime_range(record.date, record.employee_id) + if not overtime_ranges: + continue + + if record.duration < 0: + continue + + duration = record.duration + duration_real = record.duration_real + + first_range = overtime_ranges[0] + other_ranges = overtime_ranges[1:] + + if record.duration >= first_range.total_hours: + record.overtime_range_id = first_range + record.duration = first_range.total_hours * first_range.multiplier + record.duration_real = first_range.total_hours * first_range.multiplier + record.extra_hours_without_multiplier = first_range.total_hours + record.applied_multiplier = first_range.multiplier + duration -= first_range.total_hours + duration_real -= first_range.total_hours + else: + record.overtime_range_id = first_range + record.extra_hours_without_multiplier = record.duration + record.duration = record.duration * first_range.multiplier + record.duration_real = record.duration_real * first_range.multiplier + record.applied_multiplier = first_range.multiplier + duration -= first_range.total_hours + duration_real -= first_range.total_hours + + for overtime_range in other_ranges: + if duration > 0: + record.overtime_range_id = overtime_range + if duration >= overtime_range.total_hours: + duration -= overtime_range.total_hours + duration_real -= overtime_range.total_hours + self.create( + { + "adjustment": True, + "attendance_id": record.attendance_id.id, + "adjustment_overtime_id": record.id, + "duration": overtime_range.total + * overtime_range.multiplier, + "duration_real": overtime_range.total + * overtime_range.multiplier, + "extra_hours_without_multiplier": overtime_range.total_hours, + "applied_multiplier": overtime_range.multiplier, + "employee_id": record.employee_id.id, + "date": record.date, + } + ) + else: + self.create( + { + "adjustment": True, + "attendance_id": record.attendance_id.id, + "adjustment_overtime_id": record.id, + "duration": duration * overtime_range.multiplier, + "duration_real": duration * overtime_range.multiplier, + "extra_hours_without_multiplier": duration, + "applied_multiplier": overtime_range.multiplier, + "employee_id": record.employee_id.id, + "date": record.date, + } + ) + + @api.model_create_multi + def create(self, vals_list): + for attendance in self.env.context.get("attendance_ids", []): + attendance_id = self.env["hr.attendance"].browse(attendance) + for vals in vals_list: + if vals.get("employee_id") == attendance_id.employee_id.id: + vals["attendance_id"] = attendance_id.id + + record = super().create(vals_list) + if not record.filtered("adjustment"): + record._prepare_overtime_multiplier_ajustements() + return record + + @api.onchange("duration") + def onchange_duration(self): + for record in self: + if record.duration: + record.duration_real = record.duration + record.extra_hours_without_multiplier = record.duration diff --git a/l10n_br_hr_overtime_custom_multiplier/models/hr_overtime_multiplier_range.py b/l10n_br_hr_overtime_custom_multiplier/models/hr_overtime_multiplier_range.py new file mode 100644 index 0000000..11a5eb9 --- /dev/null +++ b/l10n_br_hr_overtime_custom_multiplier/models/hr_overtime_multiplier_range.py @@ -0,0 +1,103 @@ +# Copyright 2024 KMEE +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class HrOvertimeMultiplierRange(models.Model): + _name = "hr.overtime.multiplier.range" + _description = "Overtime Multiplier Range" + _order = "overtime_from" + + @api.depends("overtime_from", "overtime_to") + def _compute_total_hours(self): + for record in self: + record.total_hours = record.overtime_to - record.overtime_from + + name = fields.Char(required=True) + + monday = fields.Boolean(string="2ª", default=False) + tuesday = fields.Boolean(string="3ª", default=False) + wednesday = fields.Boolean(string="4ª", default=False) + thursday = fields.Boolean(string="5ª", default=False) + friday = fields.Boolean(string="6ª", default=False) + saturday = fields.Boolean(string="Sabado", default=False) + sunday = fields.Boolean(string="Domingo", default=False) + holiday = fields.Boolean(string="Feriado", default=False) + + overtime_from = fields.Float(string="From (hours)", required=True) + overtime_to = fields.Float(string="To (hours)", required=True) + multiplier = fields.Float(required=True) + + total_hours = fields.Float(compute="_compute_total_hours", store=True) + + @api.model + def _search_overtime_range(self, date, employee_id=None): + if not date: + return self + + exception_id = self.env["hr.attendance.exception"] + + day_name = fields.Date.from_string(date).strftime("%A").lower() + domain = [] + + if employee_id: + exception_id = exception_id.search( + [("employee_id", "=", employee_id.id), ("date", "=", date)], limit=1 + ) + + if exception_id: + domain.append((exception_id.day_of_week_override, "=", True)) + + if not exception_id: + + if day_name == "monday": + domain.append(("monday", "=", True)) + elif day_name == "tuesday": + domain.append(("tuesday", "=", True)) + elif day_name == "wednesday": + domain.append(("wednesday", "=", True)) + elif day_name == "thursday": + domain.append(("thursday", "=", True)) + elif day_name == "friday": + domain.append(("friday", "=", True)) + elif day_name == "saturday": + domain.append(("saturday", "=", True)) + elif day_name == "sunday": + domain.append(("sunday", "=", True)) + + if employee_id and employee_id.resource_calendar_id.data_eh_feriado(date): + domain.append(("holiday", "=", True)) + + overtime_ranges = self.search(domain) + return overtime_ranges + + # @api.constrains( + # 'monday', 'tuesday', 'wednesday', + # 'thursday', 'friday', 'saturday', + # 'sunday', 'holidays', 'overtime_from', 'overtime_to') + # def _check_overlap(self): + # for record in self: + # overlapping_ranges = self.search_count([ + # ('id', '!=', record.id), + # ('overtime_from', '<=', record.overtime_to), + # ('overtime_to', '>=', record.overtime_from), + # '|', + # ('monday', '=', True if record.monday else False), + # ('tuesday', '=', True if record.tuesday else False), + # '|', + # ('wednesday', '=', True if record.wednesday else False), + # '|', + # ('thursday', '=', True if record.thursday else False), + # '|', + # ('friday', '=', True if record.friday else False), + # '|', + # ('saturday', '=', True if record.saturday else False), + # '|', + # ('sunday', '=', True if record.sunday else False), + # '|', + # ('holidays', '=', True if record.holidays else False), + # ]) + # if overlapping_ranges: + # raise ValidationError("Overlapping overtime + # ranges are not allowed for the same day.") diff --git a/l10n_br_hr_overtime_custom_multiplier/models/res_config_settings.py b/l10n_br_hr_overtime_custom_multiplier/models/res_config_settings.py deleted file mode 100644 index 1412168..0000000 --- a/l10n_br_hr_overtime_custom_multiplier/models/res_config_settings.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2024 KMEE -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class ResConfigSettings(models.TransientModel): - - _inherit = "res.config.settings" - - saturday_overtime_multiplier = fields.Char( - config_parameter="saturday_overtime_multiplier", - ) - sunday_holidays_overtime_multiplier = fields.Char( - config_parameter="sunday_holidays_overtime_multiplier", - ) - business_days_over_2_hours_overtime_multiplier = fields.Char( - config_parameter="business_days_over_2_hours_overtime_multiplier", - ) - business_days_under_2_hours_overtime_multiplier = fields.Char( - config_parameter="business_days_under_2_hours_overtime_multiplier", - ) diff --git a/l10n_br_hr_overtime_custom_multiplier/security/hr_attendance_exception.xml b/l10n_br_hr_overtime_custom_multiplier/security/hr_attendance_exception.xml new file mode 100644 index 0000000..efcc145 --- /dev/null +++ b/l10n_br_hr_overtime_custom_multiplier/security/hr_attendance_exception.xml @@ -0,0 +1,22 @@ + + + + + + hr.attendance.exception access name + + + + + + + + + + diff --git a/l10n_br_hr_overtime_custom_multiplier/security/hr_overtime_multiplier_range.xml b/l10n_br_hr_overtime_custom_multiplier/security/hr_overtime_multiplier_range.xml new file mode 100644 index 0000000..21c36d1 --- /dev/null +++ b/l10n_br_hr_overtime_custom_multiplier/security/hr_overtime_multiplier_range.xml @@ -0,0 +1,22 @@ + + + + + + hr.overtime.multiplier.range access name + + + + + + + + + + diff --git a/l10n_br_hr_overtime_custom_multiplier/static/description/index.html b/l10n_br_hr_overtime_custom_multiplier/static/description/index.html index 386f3ec..d9fe15e 100644 --- a/l10n_br_hr_overtime_custom_multiplier/static/description/index.html +++ b/l10n_br_hr_overtime_custom_multiplier/static/description/index.html @@ -8,11 +8,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. -Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +274,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +300,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -369,7 +368,7 @@

L10n Br Hr Overtime Custom Multiplier

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:752d5914389dd1ab3ecccbfa3dafeacc5af9e8e70f7e60f9bf9b7b14b395ef7f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/kmee-odoo-addons Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 KMEE/kmee-odoo-addons

Module allows companies to apply a custom multiplier to overtime calculations in the Brazilian localization, providing flexible and configurable overtime management.

@@ -387,10 +386,10 @@

L10n Br Hr Overtime Custom Multiplier

Bug Tracker

-

Bugs are tracked on GitHub Issues. +

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -412,15 +411,8 @@

Contributors

Maintainers

-

This module is maintained by the OCA.

- -Odoo Community Association - -

OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use.

-

This module is part of the OCA/kmee-odoo-addons project on GitHub.

-

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+

This module is part of the KMEE/kmee-odoo-addons project on GitHub.

+

You are welcome to contribute.

diff --git a/l10n_br_hr_overtime_custom_multiplier/views/hr_attendance_exception.xml b/l10n_br_hr_overtime_custom_multiplier/views/hr_attendance_exception.xml new file mode 100644 index 0000000..655f1cc --- /dev/null +++ b/l10n_br_hr_overtime_custom_multiplier/views/hr_attendance_exception.xml @@ -0,0 +1,60 @@ + + + + + + hr.attendance.exception + +
+ + + + + + + +
+
+
+ + + hr.attendance.exception + + + + + + + + + + + hr.attendance.exception + + + + + + + + + + + Exception + hr.attendance.exception + tree,form + [] + {} + + + + + +
diff --git a/l10n_br_hr_overtime_custom_multiplier/views/hr_attendance_overtime.xml b/l10n_br_hr_overtime_custom_multiplier/views/hr_attendance_overtime.xml index 2037eed..fc3b6d4 100644 --- a/l10n_br_hr_overtime_custom_multiplier/views/hr_attendance_overtime.xml +++ b/l10n_br_hr_overtime_custom_multiplier/views/hr_attendance_overtime.xml @@ -3,30 +3,122 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> + + hr.attendance.overtime + +
+ + + + + + + + + + + + + + + +
+
+
+ + hr.attendance.overtime - - - - - + + + + + + + + + Extra hours hr.attendance.overtime - tree + tree,form,pivot + {'default_adjustment': True} + View and manage overtime records for employees + + + tree + + + + + + + + + + +
diff --git a/l10n_br_hr_overtime_custom_multiplier/views/hr_overtime_multiplier_range.xml b/l10n_br_hr_overtime_custom_multiplier/views/hr_overtime_multiplier_range.xml new file mode 100644 index 0000000..ea49135 --- /dev/null +++ b/l10n_br_hr_overtime_custom_multiplier/views/hr_overtime_multiplier_range.xml @@ -0,0 +1,74 @@ + + + + + + + + hr.overtime.multiplier.range + + + + + + + + + + + + hr.overtime.multiplier.range + + + + + + + + + + + + + + + + + + + + Multiplier Range + hr.overtime.multiplier.range + tree,form + [] + {} + + + + + diff --git a/l10n_br_hr_overtime_custom_multiplier/views/res_config_settings.xml b/l10n_br_hr_overtime_custom_multiplier/views/res_config_settings.xml deleted file mode 100644 index 55e1372..0000000 --- a/l10n_br_hr_overtime_custom_multiplier/views/res_config_settings.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - res.config.settings.form (in l10n_br_hr_overtime_custom_multiplier) - res.config.settings - - - -
-
-
-
- -
-
-
- - - -