From 895015355569e412e8ce0df6b4923683803b5a42 Mon Sep 17 00:00:00 2001
From: Ajay Patel <apa@openerp.com>
Date: Fri, 5 Sep 2014 15:17:58 +0530
Subject: [PATCH] [FIX] website: prevent t-field on selection fields

This quick fix avoids a buggy behaviour in version 8.0 that could
confuse users.

A future version should implement properly selection fields in t-field.

(closes #2490)

(cherry picked from commit fe3cac30e4c5c132da1de02576d4aa325979ccd9)
---
 addons/website/static/src/js/website.editor.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 50c939a08039..ee6368ea5aa0 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -750,6 +750,7 @@
             var def = $.Deferred();
             var editor = this.editor = CKEDITOR.inline(root, self._config());
             editor.on('instanceReady', function () {
+                $("[data-oe-type=selection]").attr("contenteditable",false);
                 editor.setReadOnly(false);
                 // ckeditor set root to editable, disable it (only inner
                 // sections are editable)
@@ -819,6 +820,7 @@
 
         fetch_editables: function (root) {
             return $(root).find('[data-oe-model]')
+                .not('[data-oe-type = "selection"]')
                 .not('link, script')
                 .not('.oe_snippet_editor')
                 .filter(function () {
-- 
GitLab