[FIX] hr_holidays: Cannot save regular allocation

Problem
-------
For regular allocation that have an empty date_from
(Allocation existing before 14.0),
it's not possible to save any change since an invisible field is required
and cannot be set.

Solution
--------
The field date from should be only required for type accrual

closes odoo/odoo#61892

X-original-commit: 700e584dd22fb7bc845675b4a49a3e5a85a7253a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Thibault Francois
2020-11-17 18:00:22 +00:00
parent 94909c3f0f
commit bb42687206
@@ -163,7 +163,7 @@
<xpath expr="//field[@name='allocation_type']" position="after">
<label for="date_from" attrs="{'invisible': [('allocation_type', '=', 'regular')]}"/>
<div class="o_row" attrs="{'invisible': [('allocation_type', '=', 'regular')]}">
<field name="date_from" widget="date" required="1" class="mr-2"/>
<field name="date_from" widget="date" class="mr-2" attrs="{'required': [('allocation_type', '=', 'accrual')]}" />
Run until <field name="date_to" help="If no value set, runs indefinitely" class="ml-2" widget="date"/>
</div>
<label for="date_from" invisible="1"/>