From f1e81a14c451d4104d249b452c83af2efbd9f04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Tue, 6 Aug 2024 10:55:20 +0200 Subject: [PATCH] fix: don't override assigned translator --- sbc_translation/models/correspondence.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sbc_translation/models/correspondence.py b/sbc_translation/models/correspondence.py index 4c100b7b1..224c4530d 100644 --- a/sbc_translation/models/correspondence.py +++ b/sbc_translation/models/correspondence.py @@ -378,9 +378,13 @@ def save_translation(self, letter_elements, translator_id=None): paragraph_index = 0 current_page = self.page_ids[page_index] if not translator_id: - translator_id = ( - self.env["translation.user"].search([("user_id", "=", self.env.uid)]).id - ) + # Don't overwrite current translator if any. + if self.new_translator_id: + translator_id = self.new_translator_id + else: + translator_id = ( + self.env["translation.user"].search([("user_id", "=", self.env.uid)]).id + ) letter_vals = { "new_translator_id": translator_id, "translation_status": "in progress",