From f4045d6004bb84ab3b212c09747e33cc63195ce3 Mon Sep 17 00:00:00 2001 From: Kevin Baptiste Date: Mon, 27 Feb 2023 09:53:26 +0000 Subject: [PATCH] [IMP] hr_contract: contract wage field as ensure_one The method `get_contract_wage_field()` was always called with a single contract record, and from a functional point of view, it doesn't make sense to call it on 2 records from different countries anyway. task-2801710 closes odoo/odoo#113731 Related: odoo/enterprise#26373 Signed-off-by: Kevin Baptiste --- addons/hr_contract/models/hr_contract.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_contract/models/hr_contract.py b/addons/hr_contract/models/hr_contract.py index dec8fc6bbbe..cc5cc34f434 100644 --- a/addons/hr_contract/models/hr_contract.py +++ b/addons/hr_contract/models/hr_contract.py @@ -224,6 +224,7 @@ class Contract(models.Model): return self[self._get_contract_wage_field()] def _get_contract_wage_field(self): + self.ensure_one() return 'wage' def write(self, vals):