From: Jeremy Kersten Date: Mon, 1 Dec 2014 16:27:50 +0000 (+0100) Subject: [FIX] website_forum: use other attr than value to init select2 X-Git-Url: http://git.inspyration.org/?p=odoo%2Fodoo.git;a=commitdiff_plain;h=5d58b5551fa11445c7ddbd2c84270946170fc803 [FIX] website_forum: use other attr than value to init select2 The backend would otherwise fail because the value has been already processed --- diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 1e2e2a4..f21deba 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -171,7 +171,7 @@ // Take default tags from the input value initSelection: function (element, callback) { var data = []; - _.each(JSON.parse(element.val()), function(x) { + _.each(element.data('init-value'), function(x) { data.push({ id: x.id, text: x.name, isNew: false }); }); element.val(''); @@ -179,7 +179,6 @@ }, }); - //TODO Remove in master if($('input.load_tags').length){ var tags = $("input.load_tags").val(); $("input.load_tags").val(""); diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index cece577..abb5048 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -376,7 +376,7 @@

- +