diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-04-14 13:32:15 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-04-14 13:32:15 +0200 |
| commit | e92ae40d71d748cd124f04656359413f038e94cc (patch) | |
| tree | 02c146d1fb67cb310cfa379429df0bd594a3bbb2 /addons/web/static/src | |
| parent | ff2ce7524b9305cc2a7f4a73a0abc744f18ec422 (diff) | |
| parent | b0992d082da329abd7b0711b64a3706f9f5ee4fc (diff) | |
[MERGE] forward port branch saas-15 up to b0992d082da
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/kanban/kanban_view.js | 25 | ||||
| -rw-r--r-- | addons/web/static/src/js/widgets/data_export.js | 12 | ||||
| -rw-r--r-- | addons/web/static/src/less/data_export.less | 14 |
3 files changed, 32 insertions, 19 deletions
diff --git a/addons/web/static/src/js/views/kanban/kanban_view.js b/addons/web/static/src/js/views/kanban/kanban_view.js index 4716e7a3bc3..2edb44abf7d 100644 --- a/addons/web/static/src/js/views/kanban/kanban_view.js +++ b/addons/web/static/src/js/views/kanban/kanban_view.js @@ -25,6 +25,13 @@ var KanbanView = BasicView.extend({ this._super.apply(this, arguments); var arch = viewInfo.arch; + + this.loadParams.limit = this.loadParams.limit || 40; + this.loadParams.openGroupByDefault = true; + this.loadParams.type = 'list'; + + this.loadParams.groupBy = arch.attrs.default_group_by ? [arch.attrs.default_group_by] : (params.groupBy || []); + var activeActions = this.controllerParams.activeActions; activeActions = _.extend(activeActions, { group_edit: arch.attrs.group_edit ? JSON.parse(arch.attrs.group_edit) : true, @@ -35,7 +42,7 @@ var KanbanView = BasicView.extend({ editable: activeActions.group_edit, deletable: activeActions.group_delete, group_creatable: true, - quick_create: params.isQuickCreateEnabled || this._isQuickCreateEnabled(arch), + quick_create: params.isQuickCreateEnabled || this._isQuickCreateEnabled(viewInfo), }; this.rendererParams.record_options = { editable: activeActions.edit, @@ -47,19 +54,17 @@ var KanbanView = BasicView.extend({ this.controllerParams.readOnlyMode = false; this.controllerParams.hasButtons = true; - - this.loadParams.limit = this.loadParams.limit || 40; - this.loadParams.openGroupByDefault = true; - this.loadParams.type = 'list'; - - this.loadParams.groupBy = arch.attrs.default_group_by ? [arch.attrs.default_group_by] : (params.groupBy || []); }, - _isQuickCreateEnabled: function (arch) { + _isQuickCreateEnabled: function (viewInfo) { + var groupBy = this.loadParams.groupBy[0]; + if(groupBy !== undefined && !_.contains(['char', 'boolean', 'many2one'], viewInfo.fields[groupBy].type)) { + return false; + } if (!this.controllerParams.activeActions.create) { return false; } - if (arch.attrs.quick_create !== undefined) { - return JSON.parse(arch.attrs.quick_create); + if (viewInfo.arch.attrs.quick_create !== undefined) { + return JSON.parse(viewInfo.arch.attrs.quick_create); } return true; } diff --git a/addons/web/static/src/js/widgets/data_export.js b/addons/web/static/src/js/widgets/data_export.js index f8c622bf5e8..44a815cf82d 100644 --- a/addons/web/static/src/js/widgets/data_export.js +++ b/addons/web/static/src/js/widgets/data_export.js @@ -207,9 +207,15 @@ var DataExport = Dialog.extend({ this.records = {}; this.dataset = dataset; this.exports = new data.DataSetSearch(this, 'ir.exports', this.dataset.get_context()); - + this.row_index = 0; this.row_index_level = 0; + + // The default for the ".modal_content" element is "max-height: 100%;" + // but we want it to always expand to "height: 100%;" for this modal. + // This can be achieved thanks to LESS modification without touching + // the ".modal-content" rules... but not with Internet explorer (11). + this.$modal.find(".modal-content").css("height", "100%"); }, start: function() { var self = this; @@ -265,7 +271,7 @@ var DataExport = Dialog.extend({ function do_setup_export_formats(formats) { var $fmts = self.$('.o_export_format'); - + _.each(formats, function(format, i) { var $radio = $('<input/>', {type: 'radio', value: format.tag, name: 'o_export_format_name'}); var $label = $('<label/>', {html: format.label}); @@ -374,7 +380,7 @@ var DataExport = Dialog.extend({ }, on_show_data: function(records, expansion) { var self = this; - + if(expansion) { this.$('.o_export_tree_item[data-id="' + expansion + '"]') .addClass('open') diff --git a/addons/web/static/src/less/data_export.less b/addons/web/static/src/less/data_export.less index 3f596bea27d..01a1da80134 100644 --- a/addons/web/static/src/less/data_export.less +++ b/addons/web/static/src/less/data_export.less @@ -1,8 +1,8 @@ .o_web_client .o_export { - - .o-flex(0, 1, 1000px); + .o-flex(1, 1, auto); .o-flex-display(); .o-flex-flow(column, nowrap); + min-height: 0; > p, > .row { .o-flex(0, 0, auto); @@ -28,8 +28,9 @@ } .o_export_panel { - .o-flex(1, 0, 0); + .o-flex(1, 1, auto); position: relative; + min-height: 0; > div { height: 100%; @@ -59,9 +60,10 @@ .o_left_field_panel, .o_fields_list { border: 1px solid @odoo-brand-lightsecondary; overflow: auto; - .o-flex(1, 0, 0); + .o-flex(1, 1, auto); + min-height: 0; } - + .o_export_tree_item { cursor: pointer; position: relative; @@ -72,7 +74,7 @@ background-color: @odoo-brand-primary; color: white; } - + .o_expand_parent { .o-position-absolute(@top: 4px, @left: 5px); } |
