From 2471ee506f38f5ca54d7bd54084b0ac3d74abeae Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 20 Sep 2019 12:46:07 +0000 Subject: [FIX] web: translate html fields This commit fixes: - body of a email.template in a small field - translation of website_description of a product does not show the source of the translation - translation of website_description of a product shows the full content for the current language HTML fields are typically fields with longer of content. If the field is an HTML field, it should be displayed in a textarea, like the text fields. Most of HTML fields are split in meaningful chunks of content (using xml_translate or html_translate method). For these fields, the source must be displayed. Also sort the entries on the source to have a consistent order closes odoo/odoo#37215 Signed-off-by: Martin Trigaux (mat) --- addons/web/static/src/js/views/basic/basic_controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_controller.js') diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index be0b9a00bf3..21ce85ce025 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -833,7 +833,8 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { userLanguageValue: ev.target.value || '', dataPointID: record.id, isComingFromTranslationAlert: ev.data.isComingFromTranslationAlert, - isText: record.fields[ev.data.fieldName].type === 'text', + isText: result.context.translation_type === 'text', + showSrc: result.context.translation_show_src, }); return this.translationDialog.open(); }, -- cgit v1.2.3