Vauxoo / odoo

Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
https://www.odoo.com
Other
9 stars 9 forks source link

[FIX] website: All menu translations on Website #356

Closed CarmenMiranda closed 4 years ago

CarmenMiranda commented 4 years ago

[FIX] website: All menu translations on Website

Currently, if we have multiple menus that its parent is not the main_menu the translation is no going to be loaded on the website. When the parent of a menu is not website.main_menu and with the conditions that right now are set root_menu.parent_id IS NULL and o_menu.parent_id = default_menu.id the translation will not be set.

For example, we have the following menus:

Without the change, the translations of the menus "Services" AND "About us" will be set but not the translation for the menu Apps because its parent instead of being the Menu_1(Default menu) is the Menu_2 ("Services") and the parent of its parent is not NULL but the Menu_2.

AFTER I did a Dummy PR on Odoo where I added 3 menus to the website "Services", "Apps" and "About us". The parent of "Services" and "About us" is website.main_menu and the parent od the menu "Apps" is "Services"

And the following results were: "Services" and "About us" were translated to "Servicios" and "Acerca de Nosotros" respectively but the menu "Apps" was not translated to "Aplicaciones" Task 39008 - Runbot Dummy not translated Runbot

On the search for the translations with the current SQL sentence, we only found the "Services" and "About us" menus. Website Menu Translations original SQL

BEFORE With this change, the translations of all the website menus of the modules will be set, and not only the ones that its parent_id is the default_menu.

Task 39008 - Dummy Translated On the search for the translations with the new SQL sentence, the Apps menu is found. Task 39008 - New Sentence SQL

opw-2209864

Signed-off-by: Carmen Miranda (CarmenMiranda) carmen@vauxoo.com I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

CarmenMiranda commented 4 years ago

Hi @hugho-ad This is the PR for the translations.

hugho-ad commented 4 years ago

@CarmenMiranda

LGTM

please open it to odoo/odoo

CarmenMiranda commented 4 years ago

Closing because the PR in Odoo was created: #51064