Commit Graph
10 Commits
Author SHA1 Message Date
704bcc5527 [IMP] portal, *: move language switcher to portal
*: base, http_routing, website

Make the language switcher available on portal without website
installed.

Part of https://github.com/odoo/odoo/pull/55300
task-2203383

Co-authored-by: Jeremy Kersten <jke@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 17:40:58 +00:00
shs-odooandNisha Patel d35adaa030 [IMP] base,base_setup: Improve general languages settings
Purpose of the task is, We saw that users encounter difficulties
while installing languages so improve the user onboarding experience
when user wants to install a new language.

So in this commit,
 - Change the load langauge wizard title as 'Add Language' and rename
the button as 'Add'
 - Removed documentation link as it is not up to date
 - Added the 'Add language' button to general settings and it will open
the wizard to load the languages. and move the 'manage language' button
to the debug mode.
 - After install added button 'switch to (lang)	& close' to switch to
newly added language.

closes odoo/odoo#53581

Taskid: 2281393
Closes: #53581
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Nisha Patel <nit@odoo.com>
2020-07-17 12:47:34 +00:00
Martin Trigaux ac63556e23 [IMP] base: explicitly pass parameters for translation methods
Instead of relying on the context content, pass explicit values for
overwrite and create_empty_translations
applu this to trans_load and trans_load_data
Adapt the test that was trying to create empty translations.
2019-11-19 10:37:07 +01:00
Martin Trigaux 49fbab5329 [IMP] base: split and deprecate load_lang
load_lang was a kind of hybrid method trying to active or creating a
language if not found. This was error prone.
Instead rely on two methods with clear purpose:
ResLang._create_lang(lang, lang_name=None)
  - create a new res.lang entry using the locale of the server
    return the res.lang record to match the API of _activate_lang

ResLang._active_lang(code)
  - activate the given code lang

Most of the time, _active_lang is what is expected

tools.trans_load_data and IrTranslation._load_module_terms no longer
activate the language if not active.
Loading the translations should be explicit on an activated language,
it is too error prone to silently activate/create a language if not
found.
Remove lang_name from trans_load_data as no longer needed.
2019-11-19 10:37:01 +01:00
Xavier-Do fc5934dc45 [FIX] base: fix rte translator timeout
In some cases, after installing a new language in rte_translator tour,
some query using ir_translation table will become very slow.

Identified query:
SELECT res_groups_users_rel.uid, res_groups_users_rel.gid
FROM res_groups_users_rel, "res_groups" LEFT JOIN "ir_translation" as "res_groups__name"
ON ("res_groups"."id" = "res_groups__name"."res_id"
AND "res_groups__name"."type" = 'model'
AND "res_groups__name"."name" = 'res.groups,name'
AND "res_groups__name"."lang" = 'en_US'
AND "res_groups__name"."value" ! '')
WHERE 1=1 AND res_groups_users_rel.uid IN (2) AND res_groups_users_rel.gid = res_groups.id
ORDER BY COALESE("res_groups__name"."value", "res_groups"."name")    OFFSET 0´

During post_install this query will become slower (between 0.7 and 2 seconds) ~50%
of the time, when this usually take less than 0.1 second.

For some tour step, this query is executed several times, making a simple
/web loading going from less than one second to more than 10 second, breaking the tour.

The main intuition behind that would be that the query plan completely fails,
mainly because postgress is to busy and doesn't have time to launch an analyse
when runbot load is high.

This commit proposes to execute a manual ANALYZE on ir_translation table
after a new language is installed. Tested with 40 builds, rte_translator never failed
with this fix.

closes odoo/odoo#36954

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-09-16 13:33:04 +00:00
Romain Derie 269aa59411 [IMP] http_routing, website: allow to customize the lang in URL
With this commit it is now possible to change the lang displayed in the URL.
Eg, you could use `/fr` instead of `/fr_BE`, or even a fancier `/french`.

Task-32838

Courtesy of pla@odoo.com

closes odoo/odoo#35135

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-08-26 16:35:19 +00:00
Martin Trigaux 30ab0d3a89 [IMP] base: better default for translation overwrite
Following 43d355c208, same logic
Hide it but make it checked by default

closes odoo/odoo#35819

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-19 14:55:57 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Thibault Delavallée c81d83773c [MOV] base: move module_* wizard into wizard/ 2017-11-27 11:15:08 +01:00