From e5f462de166fad799ff962f13dbaef6009d268eb Mon Sep 17 00:00:00 2001 From: Prakash Prajapati Date: Mon, 13 Mar 2023 09:08:10 +0000 Subject: [PATCH] [FIX] hr_work_entry_contract: fix the traceback when we edit multiple contract's Working Schedule Reproduction steps: -Install payroll app - Got to payroll > Contracts > Contracts > List view - Select multiple record and modify the Working Schedule - missing return in write closes odoo/odoo#115105 X-original-commit: fcbff003ccc4cfda48b5b266929ee49f6ace3523 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_work_entry_contract/models/hr_contract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_work_entry_contract/models/hr_contract.py b/addons/hr_work_entry_contract/models/hr_contract.py index c2a88b76c1a..7ab3ffd4f5f 100644 --- a/addons/hr_work_entry_contract/models/hr_contract.py +++ b/addons/hr_work_entry_contract/models/hr_contract.py @@ -388,8 +388,8 @@ class HrContract(models.Model): dependendant_fields = self._get_fields_that_recompute_we() if any(key in dependendant_fields for key in vals.keys()): for contract in self: - date_from = max(self.date_start, self.date_generated_from.date()) - date_to = min(self.date_end or date.max, self.date_generated_to.date()) + date_from = max(contract.date_start, contract.date_generated_from.date()) + date_to = min(contract.date_end or date.max, contract.date_generated_to.date()) if date_from != date_to: contract._recompute_work_entries(date_from, date_to) return result