[FIX] error on grouped mobile kanban with zero groups

pull/2058/head
Splash 2021-03-27 00:16:19 +03:00 committed by Sergey Shebanin
parent 7475f19f97
commit e9c2b14791
3 changed files with 46 additions and 2 deletions

View File

@ -6,7 +6,7 @@
{ {
"name": "Web Responsive", "name": "Web Responsive",
"summary": "Responsive web client, community-supported", "summary": "Responsive web client, community-supported",
"version": "14.0.1.0.0", "version": "14.0.1.0.1",
"category": "Website", "category": "Website",
"website": "https://github.com/OCA/web", "website": "https://github.com/OCA/web",
"author": "LasLabs, Tecnativa, " "Odoo Community Association (OCA)", "author": "LasLabs, Tecnativa, " "Odoo Community Association (OCA)",

View File

@ -710,6 +710,19 @@ html .o_web_client .o_action_manager .o_action {
} }
} }
//No content message improvements on mobile
@include media-breakpoint-down(md) {
.o_view_nocontent {
top: 80px;
}
.o_nocontent_help {
box-shadow: none;
}
.o_sample_data_disabled {
display: none;
}
}
// Sided chatter, if user wants // Sided chatter, if user wants
.o_chatter_position_sided & { .o_chatter_position_sided & {
@include media-breakpoint-up(lg) { @include media-breakpoint-up(lg) {

View File

@ -26,6 +26,24 @@
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.isMobile = true; this.isMobile = true;
}, },
/**
* KanbanRenderer will decide can we close quick create or not
* @private
* @override
*/
_cancel: function () {
this.trigger_up("close_quick_create");
},
/**
* Clear input when showed
* @override
*/
toggleFold: function () {
this._super.apply(this, arguments);
if (!this.folded) {
this.$input.val("");
}
},
}); });
KanbanView.include({ KanbanView.include({
@ -345,6 +363,9 @@
* and displayed * and displayed
*/ */
_moveToGroup: function (moveToIndex, animate) { _moveToGroup: function (moveToIndex, animate) {
if (this.widgets.length === 0) {
return Promise.resolve();
}
var self = this; var self = this;
if (moveToIndex >= 0 && moveToIndex < this.widgets.length) { if (moveToIndex >= 0 && moveToIndex < this.widgets.length) {
this.activeColumnIndex = moveToIndex; this.activeColumnIndex = moveToIndex;
@ -477,8 +498,8 @@
if (event) { if (event) {
event.stopPropagation(); event.stopPropagation();
} }
this.$(".o_kanban_group").toggle();
this.quickCreate.toggleFold(); this.quickCreate.toggleFold();
this.$(".o_kanban_group").toggle(this.quickCreate.folded);
}, },
/** /**
* @private * @private
@ -490,5 +511,15 @@
} }
this._moveToGroup($(event.currentTarget).index(), true); this._moveToGroup($(event.currentTarget).index(), true);
}, },
/**
* @private
* @override
*/
_onCloseQuickCreate: function () {
if (this.widgets.length && !this.quickCreate.folded) {
this.$(".o_kanban_group").toggle(true);
this.quickCreate.toggleFold();
}
},
}); });
}); });