From ea8f29e260fe87b409ad8babee27051aa51185ff Mon Sep 17 00:00:00 2001
From: Christophe Matthieu <chm@odoo.com>
Date: Tue, 19 Jul 2016 11:16:03 +0200
Subject: [PATCH] [FIX] web_editor: debug mode is not applied in the iframe of
 html field

---
 addons/web_editor/static/src/js/backend.js | 2 +-
 addons/web_editor/views/iframe.xml         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index 468fab0c7289..a20da344b034 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -251,7 +251,7 @@ var FieldTextHtml = widget.extend({
             attr.translatable = 1;
         }
         if (session.debug) {
-            attr.debug = 1;
+            attr.debug = session.debug;
         }
 
         attr.lang = attr.enable_editor ? 'en_US' : this.session.user_context.lang;
diff --git a/addons/web_editor/views/iframe.xml b/addons/web_editor/views/iframe.xml
index 6ed1f39eddf6..b73611f545a4 100644
--- a/addons/web_editor/views/iframe.xml
+++ b/addons/web_editor/views/iframe.xml
@@ -40,7 +40,7 @@
                 if (window.top.odoo &amp;&amp; !window.top.odoo[callback+"_updown"]) {
                     window.top.odoo[callback+"_updown"] = function (value, fields_values) {
                         var editable = document.getElementsByClassName("o_editable")[0];
-                        if (value !== editable.innerHTML) {
+                        if (editable &amp;&amp; value !== editable.innerHTML) {
                             editable.innerHTML = value;
                         }
                     };
-- 
GitLab