diff --git a/hr-luncheon-voucher/README.rst b/hr-luncheon-voucher/README.rst index ae4e169..ccad1d9 100644 --- a/hr-luncheon-voucher/README.rst +++ b/hr-luncheon-voucher/README.rst @@ -27,6 +27,7 @@ Configuration 1. Go to ``Configuration > Technical > Calendar > Meeting Types`` and define the meeting categories which cancel the daily luncheon voucher distribution. 2. Go to ``Configuration > General Settings > Employees`` and define if employees need to work the whole day to get a luncheon voucher. 3. Go to ``Employees`` and define for each employee the default number of luncheon vouchers to distribute in each distribution campaign. +4. Go to ``Configuration > Technical > Resource > Working Times`` and create Working Times for each combination of attendance that you have in your company. Do not forget to indicate which period are effectively attended. Use === diff --git a/hr-luncheon-voucher/__manifest__.py b/hr-luncheon-voucher/__manifest__.py index e83cc4a..967763b 100755 --- a/hr-luncheon-voucher/__manifest__.py +++ b/hr-luncheon-voucher/__manifest__.py @@ -2,7 +2,7 @@ { "name": "HR Luncheon Voucher", "category": "Human Resources", - "version": "14.0.1.0", + "version": "14.0.1.1.0", "summary": "Manage luncheon vouchers credit and distribution", "author": "Elabore", "website": "https://elabore.coop/", @@ -13,6 +13,7 @@ "base", "calendar", "hr", + "hr_effective_attendance_period", "hr_holidays", "resource", ], diff --git a/hr-luncheon-voucher/models/resource.py b/hr-luncheon-voucher/models/resource.py index e79f06c..f55451f 100644 --- a/hr-luncheon-voucher/models/resource.py +++ b/hr-luncheon-voucher/models/resource.py @@ -7,7 +7,11 @@ class ResourceCalendar(models.Model): _inherit = "resource.calendar" def _retrieve_day_matching_attendances(self, day): - domain = [("calendar_id", "=", self.id),("dayofweek", "=", day.weekday())] + domain = [ + ("calendar_id", "=", self.id), + ("dayofweek", "=", day.weekday()), + ("effective_attendance_period", "=", True) + ] if self.two_weeks_calendar: # Employee has Even/Odd weekly calendar week_type = 1 if int(math.floor((day.toordinal() - 1) / 7) % 2) else 0