summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_view.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-10-09 02:08:17 +0200
committerChristophe Simonis <chs@odoo.com>2019-10-09 02:08:17 +0200
commitd74b4518052066446e2a1975a91ce53c745ca75a (patch)
treec08180f88a512d15e37fbec628931f02b3825f65 /addons/web/static/src/js/views/basic/basic_view.js
parentec162dd0cb5622ab6e56db1a63dab5f531a96f4a (diff)
parentf4105eb9c7010f8693e5d2fd20c0bd9d9cc2e483 (diff)
[MERGE] forward port branch 13.0 up to f4105eb9c70
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_view.js')
-rw-r--r--addons/web/static/src/js/views/basic/basic_view.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_view.js b/addons/web/static/src/js/views/basic/basic_view.js
index 38d2f220c2f..5cb293e866b 100644
--- a/addons/web/static/src/js/views/basic/basic_view.js
+++ b/addons/web/static/src/js/views/basic/basic_view.js
@@ -282,29 +282,28 @@ var BasicView = AbstractView.extend({
});
}
+ attrs.views = attrs.views || {};
+
+ // Keep compatibility with 'tree' syntax
+ attrs.mode = attrs.mode === 'tree' ? 'list' : attrs.mode;
+ if (!attrs.views.list && attrs.views.tree) {
+ attrs.views.list = attrs.views.tree;
+ }
+
if (field.type === 'one2many' || field.type === 'many2many') {
if (attrs.Widget.prototype.useSubview) {
- if (!attrs.views) {
- attrs.views = {};
- }
var mode = attrs.mode;
if (!mode) {
- if (attrs.views.tree && attrs.views.kanban) {
- mode = 'tree';
- } else if (!attrs.views.tree && attrs.views.kanban) {
+ if (attrs.views.list && !attrs.views.kanban) {
+ mode = 'list';
+ } else if (!attrs.views.list && attrs.views.kanban) {
mode = 'kanban';
} else {
- mode = 'tree,kanban';
+ mode = 'list,kanban';
}
}
if (mode.indexOf(',') !== -1) {
- mode = config.device.isMobile ? 'kanban' : 'tree';
- }
- if (mode === 'tree') {
- mode = 'list';
- if (!attrs.views.list && attrs.views.tree) {
- attrs.views.list = attrs.views.tree;
- }
+ mode = config.device.isMobile ? 'kanban' : 'list';
}
attrs.mode = mode;
if (mode in attrs.views) {