Browse Source

[9.0][IMP] web_responsive: Load default kanban view for small screen and One2many related fields. (#536)

* [9.0][IMP] web_responsive: Load default kanban view for small screen and One2many related fields.

* [9.0][IMP] web_responsive: Remove unnecessary One2Many rewrite.

* Spell checking
pull/541/head
Sergio Teruel Albert 8 years ago
committed by Jairo Llopis
parent
commit
8988ebf481
  1. 5
      web_responsive/README.rst
  2. 17
      web_responsive/static/src/js/web_responsive.js

5
web_responsive/README.rst

@ -12,6 +12,8 @@ Features:
* New navigation with an App drawer
* Keyboard shortcuts for easier navigation
* Display kanban views for small screens format if an action or field One2x
has a kanban view
Installation
@ -52,6 +54,8 @@ this module.
* Adding ``oe_main_menu_navbar`` ID to the top navigation bar triggers some
great styles, but also `JavaScript that causes issues on mobile
<https://github.com/OCA/web/pull/446#issuecomment-254827880>`_
* The kanban view not is shown if an action window has no kanban mode view
Bug Tracker
===========
@ -75,6 +79,7 @@ Contributors
* Dave Lasley <dave@laslabs.com>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
Maintainer
----------

17
web_responsive/static/src/js/web_responsive.js

@ -8,6 +8,9 @@ odoo.define('web_responsive', function(require) {
var Class = require('web.Class');
var SearchView = require('web.SearchView');
var core = require('web.core');
var config = require('web.config');
var FieldOne2Many = core.form_widget_registry.get('one2many');
var ViewManager = require('web.ViewManager');
Menu.include({
@ -292,10 +295,24 @@ odoo.define('web_responsive', function(require) {
new AppDrawer();
});
// if we are in small screen change default view to kanban if exists
ViewManager.include({
get_default_view: function() {
var default_view = this._super()
if (config.device.size_class <= config.device.SIZES.XS &&
default_view != 'kanban' &&
this.views['kanban']){
default_view = 'kanban';
};
return default_view;
},
});
return {
'AppDrawer': AppDrawer,
'SearchView': SearchView,
'Menu': Menu,
'ViewManager': ViewManager,
};
});
Loading…
Cancel
Save