[FIX] website_forum: use other attr than value to init select2
[odoo/odoo.git] / addons / website_forum / static / src / js / website_forum.js
index 1e2e2a4..f21deba 100644 (file)
             // 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('');
             },
         });
 
-        //TODO Remove in master
         if($('input.load_tags').length){
             var tags = $("input.load_tags").val();
             $("input.load_tags").val("");