From 7f6924e8fd31202ddb7a09eb9a6cf76c5110689d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20De=20Caluw=C3=A9?= Date: Fri, 9 Jun 2023 14:16:09 +0000 Subject: [PATCH] [FIX] core: allow uppercase characters in translatable fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Identifiers (including column names) that are not double-quoted are folded to lowercase in PostgreSQL. Before this commit, this resulted in errors when updating translations for translatable fields, because the query did not correctly quote all identifiers. opw-3287428 closes odoo/odoo#125641 X-original-commit: 70ae8de223fc10f6e80dae06b0f6a6f15c198b5f Signed-off-by: Julien Castiaux (juc) Signed-off-by: Tom De Caluwé (tdc) --- odoo/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/models.py b/odoo/models.py index afc3d8388e7..23d4bbef4dc 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -3251,8 +3251,8 @@ class BaseModel(metaclass=MetaModel): else next((v for v in translations.values() if v is not None), None) self.invalidate_recordset([field_name]) self._cr.execute(f''' - UPDATE {self._table} - SET {field_name} = NULLIF( + UPDATE "{self._table}" + SET "{field_name}" = NULLIF( jsonb_strip_nulls(%s || COALESCE("{field_name}", '{{}}'::jsonb) || %s), '{{}}'::jsonb) WHERE id = %s