[MIG] hr_payroll_timesheet: for Odoo Enterprise 14.0

This commit is contained in:
Jared Kipe
2020-11-27 14:25:10 -08:00
parent c1b9fb4eff
commit 7da29f9972
8 changed files with 172 additions and 142 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 fields, models
from odoo import api, fields, models
class HrContract(models.Model):
_inherit = 'hr.contract'
paid_hourly_timesheet = fields.Boolean(string="Paid Hourly Timesheet", default=False)
@api.onchange('paid_hourly_timesheet')
def _onchange_paid_hourly_timesheet(self):
for contract in self:
if contract.paid_hourly_timesheet:
# only allow switch, not automatic switch 'back'
contract.wage_type = 'hourly'