[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.
This commit is contained in:
Jared Kipe
2020-11-27 14:20:26 -08:00
parent 0dfee20750
commit 9f59dd2dee
7 changed files with 101 additions and 144 deletions

View File

@@ -1,9 +1,16 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
from odoo import models, fields
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'