File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Features:
1212
1313 * New navigation with an App drawer
1414 * Keyboard shortcuts for easier navigation
15+ * Display kanban views for small screens format if an action or field One2x
16+ has a kanban view
1517
1618
1719Installation
@@ -52,6 +54,8 @@ this module.
5254* Adding ``oe_main_menu_navbar `` ID to the top navigation bar triggers some
5355 great styles, but also `JavaScript that causes issues on mobile
5456 <https://github.com/OCA/web/pull/446#issuecomment-254827880> `_
57+ * The kanban view not is shown if an action window has no kanban mode view
58+
5559
5660Bug Tracker
5761===========
@@ -75,6 +79,7 @@ Contributors
7579
7680* Dave Lasley <dave@laslabs.com>
7781* Jairo Llopis <jairo.llopis@tecnativa.com>
82+ * Sergio Teruel <sergio.teruel@tecnativa.com>
7883
7984Maintainer
8085----------
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ odoo.define('web_responsive', function(require) {
88 var Class = require ( 'web.Class' ) ;
99 var SearchView = require ( 'web.SearchView' ) ;
1010 var core = require ( 'web.core' ) ;
11+ var config = require ( 'web.config' ) ;
12+ var FieldOne2Many = core . form_widget_registry . get ( 'one2many' ) ;
13+ var ViewManager = require ( 'web.ViewManager' ) ;
1114
1215 Menu . include ( {
1316
@@ -292,10 +295,24 @@ odoo.define('web_responsive', function(require) {
292295 new AppDrawer ( ) ;
293296 } ) ;
294297
298+ // if we are in small screen change default view to kanban if exists
299+ ViewManager . include ( {
300+ get_default_view : function ( ) {
301+ var default_view = this . _super ( )
302+ if ( config . device . size_class <= config . device . SIZES . XS &&
303+ default_view != 'kanban' &&
304+ this . views [ 'kanban' ] ) {
305+ default_view = 'kanban' ;
306+ } ;
307+ return default_view ;
308+ } ,
309+ } ) ;
310+
295311 return {
296312 'AppDrawer' : AppDrawer ,
297313 'SearchView' : SearchView ,
298314 'Menu' : Menu ,
315+ 'ViewManager' : ViewManager ,
299316 } ;
300317
301318} ) ;
You can’t perform that action at this time.
0 commit comments