addons/hr_timesheet/models/hr_employee_public.py
raw| 1 | # Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 | |
| 3 | from odoo import fields, models |
| 4 | |
| 5 | |
| 6 | class HrEmployeePublic(models.Model): |
| 7 | _inherit = 'hr.employee.public' |
| 8 | |
| 9 | has_timesheet = fields.Boolean(related='employee_id.has_timesheet') |
| 10 | |
| 11 | def action_timesheet_from_employee(self): |
| 12 | self.ensure_one() |
| 13 | if self.is_user: |
| 14 | return self.employee_id.action_timesheet_from_employee() |