Files
odoo_source/addons/hr_work_entry/models/resource.py
T
lbs-odoo 981907fd43 [ADD] hr_work_entry: Move work entries mechanism into its own module
Purpose
=======

We would like to re-use the work entries in the attendance module.

As hr_attendance is not dependant on hr_payroll, we move the whole
mechanism into its own module.

This could be reused too into others modules, like forecasting or whatever.

TaskID: 1904850

closes odoo/odoo#34434

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-05 07:40:06 +00:00

20 lines
659 B
Python

# -*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class ResourceCalendarAttendance(models.Model):
_inherit = 'resource.calendar.attendance'
def _default_work_entry_type_id(self):
return self.env.ref('hr_work_entry.work_entry_type_attendance', raise_if_not_found=False)
work_entry_type_id = fields.Many2one('hr.work.entry.type', 'Work Entry Type', default=_default_work_entry_type_id)
class ResourceCalendarLeave(models.Model):
_inherit = 'resource.calendar.leaves'
work_entry_type_id = fields.Many2one('hr.work.entry.type', 'Work Entry Type')