mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
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.
17 lines
565 B
Python
Executable File
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'
|