[FIX] Can't move kanban card from one group to another in some cases
authorFabien Meghazi <fme@openerp.com>
Wed, 22 Feb 2012 11:37:18 +0000 (12:37 +0100)
committerFabien Meghazi <fme@openerp.com>
Wed, 22 Feb 2012 11:37:18 +0000 (12:37 +0100)
lp bug: https://launchpad.net/bugs/937637 fixed

bzr revid: fme@openerp.com-20120222113718-ix9kb61ij8jg4tub

addons/web_kanban/static/src/js/kanban.js

index 49964ed..d04622b 100644 (file)
@@ -276,14 +276,15 @@ openerp.web_kanban.KanbanGroup = openerp.web.OldWidget.extend({
         if (this.group) {
             this.value = group.value;
             this.title = group.value;
+            if (this.value instanceof Array) {
+                this.title = this.value[1];
+                this.value = this.value[0];
+            }
             var field = this.view.fields_view.fields[this.view.group_by];
             if (field) {
                 try {
-                    this.title = openerp.web.format_value(this.value, field, false);
+                    this.title = openerp.web.format_value(group.value, field, false);
                 } catch(e) {}
-            } else if (this.value instanceof Array) {
-                this.title = this.value[1];
-                this.value = this.value[0];
             }
             _.each(this.view.aggregates, function(value, key) {
                 self.aggregates[value] = group.aggregates[key];