[FIX] hr_holidays: restrict creation of allocations

Purpose: It does not make much sense to create allocations of such an
Time Off Types that don't require allocation.

task - 2658250

closes odoo/odoo#80541

X-original-commit: 69cee9c13b1d5267b74a9f107bae85ea1c42aa38
Related: odoo/enterprise#22589
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
sofiagvaladze
2021-11-29 16:28:05 +00:00
parent 12589081b0
commit 704ad908a1
2 changed files with 5 additions and 4 deletions
@@ -37,7 +37,7 @@ class HolidaysAllocation(models.Model):
def _domain_holiday_status_id(self):
if self.user_has_groups('hr_holidays.group_hr_holidays_user'):
return []
return [('requires_allocation', '=', 'yes')]
return [('employee_requests', '=', 'yes')]
name = fields.Char('Description', compute='_compute_description', inverse='_inverse_description', search='_search_description', compute_sudo=False)
@@ -110,10 +110,11 @@
<tree string="Time Off Type">
<field name="sequence" widget="handle"/>
<field name="display_name"/>
<field name="allocation_validation_type"/>
<field name="employee_requests" optional="hide"/>
<field name="requires_allocation" optional="hide"/>
<field name="leave_validation_type" optional="hide"/>
<field name="allocation_validation_type" optional="hide"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="leave_validation_type" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" optional="hide"/>
</tree>
</field>
</record>