diff options
| author | Nidhi Patel <nia@odoo.com> | 2020-10-07 12:24:18 +0000 |
|---|---|---|
| committer | Barad Mahendra <mba@openerp.com> | 2020-12-09 06:25:22 +0000 |
| commit | c54f445ceae72518f787f43213ec78a9a7e1b1eb (patch) | |
| tree | aa9f86f1d6b45d3dbac02cde6f1bd60dcbc883fb /addons/hr_holidays | |
| parent | 9f70f405bc453ce56b75d22a318c9fd72e8bd496 (diff) | |
[FIX] hr_holidays: Fix display of a wrong warning message
Currently, when we create time off and does not add 'Start Date' or
'End Date', it displays a wrong warning.
Issue is occur because date_from is required field at db level and it's
value computed based on visible field request_date_from which is
non-required field and when you keep that empty it will raisse the
contraint instead of required error.
So in this commit, we make request_date_field field required from view
and also make request_date_to visible based on condition so it should
fill the proper value inside the date_from and date_to.
closes odoo/odoo#59586
Taskid: 2352360
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/hr_holidays')
| -rw-r--r-- | addons/hr_holidays/views/hr_leave_views.xml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml index eca899b2761..f732af9a88a 100644 --- a/addons/hr_holidays/views/hr_leave_views.xml +++ b/addons/hr_holidays/views/hr_leave_views.xml @@ -245,7 +245,9 @@ From </span> <field name="request_date_from" class="oe_inline" nolabel="1" - attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))]}"/> + attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))], + 'required': ['|', ('date_from', '=', False), ('date_to', '=', False)] + }"/> <span class="oe_inline" attrs="{'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)]}"> To @@ -253,7 +255,8 @@ <field name="request_date_to" class="oe_inline" attrs="{ 'readonly': [('state', 'not in', ('draft', 'confirm'))], - 'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)] + 'invisible': ['|', ('request_unit_half', '=', True), ('request_unit_hours', '=', True)], + 'required': ['|', ('date_from', '=', False), ('date_to', '=', False)] }"/> <field name="request_date_from_period" class="oe_inline" string="In" |
