Files
suite/hr_payroll_attendance/models/hr_contract.py
Jared Kipe 9f59dd2dee [MIG] hr_payroll_attendance: for Odoo Enterprise 13.0
Move some concerns to other modules, refactor new API to make it possible to use timesheets and attendances together.

Now possible to add attendances by hand or import via smart button and 'recompute' attendances.
2020-11-27 14:20:26 -08:00

17 lines
565 B
Python
Executable File

# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from odoo import api, models, fields
class HrContract(models.Model):
_inherit = 'hr.contract'
paid_hourly_attendance = fields.Boolean(string="Paid Hourly Attendance")
@api.onchange('paid_hourly_attendance')
def _onchange_paid_hourly_attendance(self):
for contract in self:
if contract.paid_hourly_attendance:
# only allow switch, not automatic switch 'back'
self.wage_type = 'hourly'