From d34d142c8ab3be9d1615740fa2609117cc85fd64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 23 Jan 2015 14:48:17 +0100 Subject: [PATCH] [FIX] web_kanban: do not fetch data and do not try to place tags for m2m that are actually not used in the qwek template of the kanban view itself. This is the case for example when having a m2m declared to have access to its raw_value. --- addons/web_kanban/static/src/js/kanban.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 0d9af48e34d..08b61c7b187 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -570,6 +570,14 @@ instance.web_kanban.KanbanView = instance.web.View.extend({ self.many2manys.forEach(function(name) { var field = record.record[name]; var $el = record.$('.oe_form_field.oe_tags[name=' + name + ']').empty(); + // fields declared in the kanban view may not be used directly + // in the template declaration, for example fields for which the + // raw value is used -> $el[0] is undefined, leading to errors + // in the following process. Preventing to add push the id here + // prevents to make unnecessary calls to name_get + if (! $el[0]) { + return; + } if (!relations[field.relation]) { relations[field.relation] = { ids: [], elements: {}}; }