summaryrefslogtreecommitdiff
path: root/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/hr_holidays/wizard/hr_holidays_summary_employees.py
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/hr_holidays/wizard/hr_holidays_summary_employees.py')
-rw-r--r--addons/hr_holidays/wizard/hr_holidays_summary_employees.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_employees.py b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
new file mode 100644
index 00000000..fccc9269
--- /dev/null
+++ b/addons/hr_holidays/wizard/hr_holidays_summary_employees.py
@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+import time
+
+from odoo import api, fields, models
+
+
+class HolidaysSummaryEmployee(models.TransientModel):
+
+ _name = 'hr.holidays.summary.employee'
+ _description = 'HR Time Off Summary Report By Employee'
+
+ date_from = fields.Date(string='From', required=True, default=lambda *a: time.strftime('%Y-%m-01'))
+ emp = fields.Many2many('hr.employee', 'summary_emp_rel', 'sum_id', 'emp_id', string='Employee(s)')
+ holiday_type = fields.Selection([
+ ('Approved', 'Approved'),
+ ('Confirmed', 'Confirmed'),
+ ('both', 'Both Approved and Confirmed')
+ ], string='Select Time Off Type', required=True, default='Approved')
+
+ def print_report(self):
+ self.ensure_one()
+ [data] = self.read()
+ data['emp'] = self.env.context.get('active_ids', [])
+ employees = self.env['hr.employee'].browse(data['emp'])
+ datas = {
+ 'ids': [],
+ 'model': 'hr.employee',
+ 'form': data
+ }
+ return self.env.ref('hr_holidays.action_report_holidayssummary').report_action(employees, data=datas)