diff options
| author | Yannick Tivisse <yti@odoo.com> | 2020-11-30 14:56:56 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-12-01 12:27:12 +0000 |
| commit | 46a56bccb171c3092d203ac000e98d5914f746cc (patch) | |
| tree | 066c503e0b5123ee7ec386bf556e8c8615e3851a /addons/hr_work_entry | |
| parent | f70f017a04c4d0e2aaf378cce9541b01b42ed0a7 (diff) | |
[FIX] hr_work_entry: Copy work entry type on calendar creation
Purpose
=======
The global attendances / global time off are copied but not their work
entry types.
Diffstat (limited to 'addons/hr_work_entry')
| -rw-r--r-- | addons/hr_work_entry/models/resource.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/hr_work_entry/models/resource.py b/addons/hr_work_entry/models/resource.py index bf05682d221..ac7fa6c9660 100644 --- a/addons/hr_work_entry/models/resource.py +++ b/addons/hr_work_entry/models/resource.py @@ -12,8 +12,18 @@ class ResourceCalendarAttendance(models.Model): work_entry_type_id = fields.Many2one('hr.work.entry.type', 'Work Entry Type', default=_default_work_entry_type_id) + def _copy_attendance_vals(self): + res = super()._copy_attendance_vals() + res['work_entry_type_id'] = self.work_entry_type_id.id + return res + class ResourceCalendarLeave(models.Model): _inherit = 'resource.calendar.leaves' work_entry_type_id = fields.Many2one('hr.work.entry.type', 'Work Entry Type') + + def _copy_leave_vals(self): + res = super()._copy_leave_vals() + res['work_entry_type_id'] = self.work_entry_type_id.id + return res |
