mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[MIG] hr_payroll_timesheet: for Odoo Enterprise 14.0
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user