Commit Graph
8 Commits
Author SHA1 Message Date
Jeremy Kersten 4c40393490 [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 #47257
task-2211013

X-original-commit: 0dc54814161ab55c34dd2242f65dea23d19fdfca
2020-03-19 15:37:47 +00:00
Martin Trigaux 8b8815f44c [FIX] http_routing: translate without website
web (tagged with `openerp-web`) translations are loaded in the backend, in
`odoo.addons.web.controllers.main.WebClient.translation(mods=None, lang=None)`
method (through `/web/webclient/translations` controller).

In website, the controller `/website/translations` is called used, fetching
the translations from modules with the (fragile) clause `name ilike 'website'`

This commit fixes two bugs:

1. Install `website_sale`, activate discussion on products
  -> the chatter is not translated as the portal translations not loaded in the
     `/website/translations` controller

2. Install `helpdesk` but not `website`, go to portal view of a ticket
   -> the heldesk chatter is not translated as the `/website/translations`
      controller is not called (only provided by the website module)

This patch implements a modular approach to translate the web resources of the
right modules only.

The controller /website/translation is moved to http_routing and each module
override the new _get_translation_frontend_modules_domain method to adds its
translatable module

Closes #23618
Fixes #23610
2018-04-11 16:55:14 +02:00
Christophe Simonis 657e328903 [MERGE] forward port branch saas-11 up to 7b0a1e4031 2017-07-04 12:28:38 +02:00
Nicolas Lempereur b3e7753d1b [FIX] web{site,_editor}: allow edit en_US field
If the website default language is not en_US, qweb fields are not
translatable in en_US (and thus can't be translated) because:

- the code expected en_US to be the default language.
- there was a error in website _dispatch

opw-746776
closes #17939
2017-06-30 14:14:27 +02:00
Raphael Collet 70dec2d896 [REF] registry: now mapping model name to model class 2016-08-31 17:21:59 +02:00
Raphael Collet 75dc39e042 [REF] openerp.http: make request.context consistent with request.env.context 2016-08-31 17:21:58 +02:00
fwi-odoo a32c1d3c8d [MIG] web_editor: migrate to new api 2016-08-03 13:42:25 +02:00
Christophe Matthieu 8c559044a5 [IMP] web_editor: split website into web_editor (to use editor in backend for html field) and website 2015-07-10 17:00:11 +02:00