[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) <gdi@odoo.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user