From f8ed130425384cd3d7ed7e5a6be253dfb1e0db43 Mon Sep 17 00:00:00 2001 From: bat-odoo Date: Wed, 11 Nov 2020 10:50:33 +0000 Subject: [PATCH] [FIX] pad: FIX error on pad when switching projects. Currently, when we have pad issue when we switch the pad to html editor. for Ex: In the Project app with the Collaborative Pad activated, if we create a task and change the Project name multiple times (one having the Collaborative Pad activated while the other not activated), then at one point the Collaborative Pad doesn't show up and it will display object object. issue is due to object value of the url and it was not going to check for the startwith 'http'. So in this commit, When value is json method convert it to the json object so the value must check proper condition for the startsWith(this.value, 'http'). closes odoo/odoo#63047 Taskid: 2336325 X-original-commit: 73bfe794351b2881fed041983b90f3d90025d23e Signed-off-by: Yannick Tivisse (yti) --- addons/pad/static/src/js/pad.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/pad/static/src/js/pad.js b/addons/pad/static/src/js/pad.js index 5fb90b50a99..02b34f2b725 100644 --- a/addons/pad/static/src/js/pad.js +++ b/addons/pad/static/src/js/pad.js @@ -39,6 +39,9 @@ var FieldPad = AbstractField.extend({ this.$(".oe_configured").addClass('d-none'); return Promise.resolve(); } + if (this.mode === 'edit' && typeof(this.value) === 'object') { + this.value = this.value.toJSON(); + } if (this.mode === 'edit' && _.str.startsWith(this.value, 'http')) { this.url = this.value; // please close your eyes and look elsewhere...