From 2030e1fa672a7253c18da4e3e62243ae648ec3d1 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 17 Apr 2024 10:49:28 +0200 Subject: [PATCH] [FIX] website: get env correctly on configurator_apply Commit [1] in 17 introduced a `request.env` instead of `self.env` in `configurator_apply()`. It was not seen and went through the merge. It should not have any bad impact in real use cases as the method is always called from the frontend context and `request` is bound but we have this test [2] which was introduced in 17.1 which is calling `configurator_apply()` in a python standalone unit test, where `request` is unbound. It allowed us to detect the mistake since the nightly was red because of it. [1]: https://github.com/odoo/odoo/commit/9f319cbc95f8f4cb76df6f2b82e4b43a74f4b753 [2]: https://github.com/odoo/design-themes/commit/b8aae07df41b44aa78cf39ff6104136556199130 closes odoo/odoo#162170 Signed-off-by: Guillaume Dieleman (gdi) --- addons/website/models/website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/website.py b/addons/website/models/website.py index f679272602b..d2c32baf81c 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -656,7 +656,7 @@ class Website(models.Model): if translated_ratio > 0.8: try: - database_id = request.env['ir.config_parameter'].sudo().get_param('database.uuid') + database_id = self.env['ir.config_parameter'].sudo().get_param('database.uuid') response = self._OLG_api_rpc('/api/olg/1/generate_placeholder', { 'placeholders': list(generated_content.keys()), 'lang': website.default_lang_id.name,