From f3725a3dde8c8ef648d62dd41708cacb01860457 Mon Sep 17 00:00:00 2001 From: Nidhi Patel Date: Wed, 7 Oct 2020 12:24:18 +0000 Subject: [PATCH] [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#63222 Taskid: 2352360 X-original-commit: c54f445ceae72518f787f43213ec78a9a7e1b1eb Signed-off-by: Yannick Tivisse (yti) --- addons/hr_holidays/views/hr_leave_views.xml | 7 +++++-- 1 file 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 1ee485953d5..41b8c50edfc 100644 --- a/addons/hr_holidays/views/hr_leave_views.xml +++ b/addons/hr_holidays/views/hr_leave_views.xml @@ -245,7 +245,9 @@ From + attrs="{'readonly': [('state', 'not in', ('draft', 'confirm'))], + 'required': ['|', ('date_from', '=', False), ('date_to', '=', False)] + }"/> To @@ -253,7 +255,8 @@