diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index a6a6da5a6d7..093b3651fa0 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -373,6 +373,12 @@ QWeb2.Engine = (function() { if (!this.jQuery) { return this.tools.exception("Can't extend template " + template + " without jQuery"); } + var template_dest = this.templates[template], + msie_trololo = false; + if (template_dest.xml !== undefined) { + template_dest = this.jQuery(template_dest.xml); + msie_trololo = true; + } for (var i = 0, ilen = extend_node.childNodes.length; i < ilen; i++) { var child = extend_node.childNodes[i]; if (child.nodeType === 1) { @@ -382,7 +388,7 @@ QWeb2.Engine = (function() { target, error_msg = "Error while extending template '" + template; if (jquery) { - target = this.jQuery(jquery, this.templates[template]); + target = this.jQuery(jquery, template_dest); } else if (xpath) { // NOTE: due to the XPath implementation, extending a template will only work once // when using XPath because XPathResult won't match objects with other constructor than 'Element' @@ -415,6 +421,9 @@ QWeb2.Engine = (function() { } } } + if (msie_trololo) { + this.templates[template] = template_dest[0]; + } } }); return Engine; diff --git a/addons/web/static/test/formats.js b/addons/web/static/test/formats.js index f9f34dd44c0..cde11a188c0 100644 --- a/addons/web/static/test/formats.js +++ b/addons/web/static/test/formats.js @@ -113,6 +113,8 @@ $(document).ready(function () { equal(g("12345678", [2, 0, 1], '.'), '12.34.56.78'); equal(g("12345678", [2, 0, 0], '.'), '12.34.56.78'); equal(g("12345678", [2, 0, -1], '.'), '12.34.56.78'); + equal(g("12345678", [3,3,3,3], '.'), '12.345.678'); + equal(g("12345678", [3,0], '.'), '12.345.678'); }); test('format_integer', function () { openerp.web._t.database.parameters.grouping = [3, 3, 3, 3]; diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index c21b5bc151e..921f28e7135 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -380,7 +380,11 @@ openerp.web_kanban.KanbanRecord = openerp.web.Widget.extend({ new_record = {}; _.each(record, function(value, name) { var r = _.clone(self.view.fields_view.fields[name] || {}); - r.raw_value = value; + if ((r.type === 'date' || r.type === 'datetime') && value) { + r.raw_value = openerp.web.auto_str_to_date(value); + } else { + r.raw_value = value; + } r.value = openerp.web.format_value(value, r); new_record[name] = r; });