summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorRomainLibert <rli@odoo.com>2018-09-06 10:46:29 +0200
committerRomainLibert <rli@odoo.com>2018-09-07 17:28:09 +0200
commitf63bf09cdd5ebcd6e3d112f180a3e2dec275136f (patch)
treed845a9218cc56865de06b5c200c09171d7abdbd0 /addons
parent5020f41b9586502ad2edf790bc87af4726e3157d (diff)
[FIX] hr_holidays: make related fields readonly
In the allocations we have two related fields on hr.leave.type but a user cannot write on these fields hence we should make them readonly
Diffstat (limited to 'addons')
-rw-r--r--addons/hr_holidays/models/hr_leave_allocation.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/hr_holidays/models/hr_leave_allocation.py b/addons/hr_holidays/models/hr_leave_allocation.py
index 8ff2d5d6d41..aa5dda2f467 100644
--- a/addons/hr_holidays/models/hr_leave_allocation.py
+++ b/addons/hr_holidays/models/hr_leave_allocation.py
@@ -84,10 +84,10 @@ class HolidaysAllocation(models.Model):
help='This area is automatically filled by the user who validate the leave', oldname='manager_id')
second_approver_id = fields.Many2one('hr.employee', string='Second Approval', readonly=True, copy=False, oldname='manager_id2',
help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
- validation_type = fields.Selection('Validation Type', related='holiday_status_id.validation_type')
+ validation_type = fields.Selection('Validation Type', related='holiday_status_id.validation_type', readonly=True)
can_reset = fields.Boolean('Can reset', compute='_compute_can_reset')
can_approve = fields.Boolean('Can Approve', compute='_compute_can_approve')
- type_request_unit = fields.Selection(related='holiday_status_id.request_unit')
+ type_request_unit = fields.Selection(related='holiday_status_id.request_unit', readonly=True)
accrual = fields.Boolean("Accrual", related='holiday_status_id.accrual', store=True, readonly=True)
number_per_interval = fields.Float("Number of unit per interval", readonly=True, states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}, default=1)
interval_number = fields.Integer("Number of unit between two intervals", readonly=True, states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]}, default=1)