-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] website: perf - translation - avoid query to find what we know
Before this commit, each module override _get_translation_frontend_modules_domain from ir.http to add its own translation in website if needed and that module is not starting by website_. Updating the domain from the super() call. Since we know in most of the case the name, it is useless to do a: select name from module where name = 'name1' or name = 'name2'... Now we support a new override of _get_translation_frontend_modules_name that will allow to add the known module name directly in the list instead to make a search. In case nobody override _get_translation_frontend_modules_domain, we don't need to make an extra rpc to find the module. Related to odoo#47257 task-2211013
- Loading branch information
Showing
6 changed files
with
34 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from odoo import api, fields, models | ||
from odoo.osv import expression | ||
from odoo import models | ||
|
||
|
||
class IrHttp(models.AbstractModel): | ||
_inherit = 'ir.http' | ||
|
||
@classmethod | ||
def _get_translation_frontend_modules_domain(cls): | ||
domain = super(IrHttp, cls)._get_translation_frontend_modules_domain() | ||
return expression.OR([domain, [('name', '=', 'im_livechat')]]) | ||
def _get_translation_frontend_modules_name(cls): | ||
mods = super(IrHttp, cls)._get_translation_frontend_modules_name() | ||
return mods + ['im_livechat'] |