self.do_clear_groups();
self.dataset.read_slice(self.fields_keys.concat(['__last_update']), { 'limit': self.limit }).done(function(records) {
var kgroup = new instance.web_kanban.KanbanGroup(self, records, null, self.dataset);
+ if (!_.isEmpty(self.dataset.ids) && (self.dataset.index === null || self.dataset.index >= self.dataset.ids.length)) {
+ self.dataset.index = 0;
+ } else if (_.isEmpty(self.dataset.ids)){
+ self.dataset.index = null;
+ }
self.do_add_groups([kgroup]).done(function() {
if (_.isEmpty(records)) {
self.no_result();
stop: function(event, ui) {
var stop_index = ui.item.index();
if (start_index !== stop_index) {
- var $start_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);
- var $stop_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);
+ var $start_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);
+ var $stop_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);
var method = (start_index > stop_index) ? 'insertBefore' : 'insertAfter';
$start_column[method]($stop_column);
var tmp_group = self.groups.splice(start_index, 1)[0];
*/
instance.web_kanban.QuickCreate = instance.web.Widget.extend({
template: 'KanbanView.quick_create',
-
+
/**
* close_btn: If true, the widget will display a "Close" button able to trigger
* a "close" event.
this.record_id = self.parent.id;
this.priorities = self.prepare_priority();
this.$el = $(QWeb.render("Priority", {'widget': this}));
- this.$el.find('.oe_legend').click(self.do_action.bind(self));
+ this.$el.find('li').click(self.do_action.bind(self));
},
do_action: function(e) {
var self = this;
this.record_id = self.parent.id;
this.states = self.prepare_dropdown_selection();;
this.$el = $(QWeb.render("KanbanSelection", {'widget': self}));
- this.$el.find('.oe_legend').click(self.do_action.bind(self));
+ this.$el.find('li').click(self.do_action.bind(self));
},
do_action: function(e) {
var self = this;