diff --git a/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard.py b/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard.py
index cc6928d15b1..62e48f7ff5d 100644
--- a/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard.py
+++ b/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard.py
@@ -26,7 +26,7 @@ class HrWorkEntryRegenerationWizard(models.TransientModel):
@api.depends('date_from')
def _compute_date_to(self):
for wizard in self:
- wizard.date_to = wizard.date_from + relativedelta(months=+1, day=1, days=-1)
+ wizard.date_to = wizard.date_from and wizard.date_from + relativedelta(months=+1, day=1, days=-1)
@api.depends('employee_ids')
def _compute_earliest_available_date(self):
diff --git a/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard_views.xml b/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard_views.xml
index 6540e6d71f8..7d76fc6aa2d 100644
--- a/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard_views.xml
+++ b/addons/hr_work_entry_contract/wizard/hr_work_entry_regeneration_wizard_views.xml
@@ -55,8 +55,7 @@
attrs="{'invisible': ['|', ('search_criteria_completed', '=', False), ('valid', '=', False)]}"/>