diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index ca863513961..54f02d6bf0a 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -727,11 +727,9 @@ label.error { padding: 10px 0 10px 0; vertical-align:middle; } -.openerp .oe_search-view-custom-filter-btn span { - background: url(/web/static/src/img/icons/gtk-add.png) repeat-y; - padding-left: 18px; +.openerp .oe_search-view-filters-management { + float: right; } - .openerp .oe_search-view-filters-management, .openerp .oe_search-view-custom-filter-btn { float:right; } @@ -1192,7 +1190,11 @@ label.error { .openerp .oe_forms select{ padding-top: 2px; } - +.openerp .oe_forms input[disabled], +.openerp .oe_forms select[disabled], +.openerp .oe_forms textarea[disabled]{ + background: #E0E0E0; +} .openerp .oe_forms textarea { resize:vertical; } diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index f737d8eb92a..83f7f971434 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -916,6 +916,8 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ if (!(this.folded && manual)) { this.do_show_secondary($sub_menu, $main_menu); + } else { + this.do_show_secondary(); } if ($main_menu != $clicked_menu) { @@ -941,8 +943,15 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ } return false; }, + do_hide_secondary: function() { + this.$secondary_menu.hide(); + }, do_show_secondary: function($sub_menu, $main_menu) { var self = this; + this.$secondary_menu.show(); + if (!arguments.length) { + return; + } if (this.folded) { var css = $main_menu.position(), fold_width = this.$secondary_menu.width() + 2, diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index d1e4b161b39..9b485b457cd 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -155,6 +155,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search var ext = new openerp.web.search.ExtendedSearch(this, this.model); lines.push([ext]); this.inputs.push(ext); + this.extended_search = ext; var render = QWeb.render("SearchView", { 'view': data.fields_view['arch'], @@ -163,7 +164,6 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search }); this.$element.html(render); - this.$element.find(".oe_search-view-custom-filter-btn").click(ext.on_activate); var f = this.$element.find('form'); this.$element.find('form') @@ -199,6 +199,9 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search var select = this.$element.find(".oe_search-view-filters-management"); var val = select.val(); switch(val) { + case 'advanced_filter': + this.extended_search.on_activate(); + break; case 'add_to_dashboard': this.on_add_to_dashboard(); break; diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index fef32df4a90..5908dc67dc6 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -619,8 +619,8 @@ openerp.web.form.SidebarAttachments = openerp.web.Widget.extend({ var $e = $(e.target); if ($e.val() != '') { this.$element.find('form.oe-binary-form').submit(); - $e.parent().find('input[type=file]').attr('disabled', 'true'); - $e.parent().find('button').attr('disabled', 'true').find('img, span').toggle(); + $e.parent().find('input[type=file]').prop('disabled', true); + $e.parent().find('button').prop('disabled', true).find('img, span').toggle(); } }, on_attachment_delete: function(e) { @@ -1094,13 +1094,9 @@ openerp.web.form.WidgetButton = openerp.web.form.Widget.extend({ this.check_disable(); }, check_disable: function() { - if (this.readonly || this.force_disabled || !this.view.is_interactible_record()) { - this.$element.find("button").attr("disabled", "disabled"); - this.$element.find("button").css("color", "grey"); - } else { - this.$element.find("button").removeAttr("disabled"); - this.$element.find("button").css("color", ""); - } + var disabled = (this.readonly || this.force_disabled || !this.view.is_interactible_record()); + this.$element.find('button').prop('disabled', disabled); + this.$element.find("button").css('color', disabled ? 'grey' : ''); } }); @@ -1268,7 +1264,7 @@ openerp.web.form.FieldChar = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$element.find('input').attr('disabled', this.readonly); + this.$element.find('input').prop('disabled', this.readonly); }, set_value_from_ui: function() { this.value = openerp.web.parse_value(this.$element.find('input').val(), this); @@ -1392,7 +1388,7 @@ openerp.web.DateTimeWidget = openerp.web.Widget.extend({ }, set_readonly: function(readonly) { this.readonly = readonly; - this.$input.attr('disabled', this.readonly); + this.$input.prop('disabled', this.readonly); this.$element.find('img.oe_datepicker_trigger').toggleClass('oe_input_icon_disabled', readonly); }, is_valid: function(required) { @@ -1479,7 +1475,7 @@ openerp.web.form.FieldText = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$element.find('textarea').attr('disabled', this.readonly); + this.$element.find('textarea').prop('disabled', this.readonly); }, set_value_from_ui: function() { this.value = openerp.web.parse_value(this.$element.find('textarea').val(), this); @@ -1516,7 +1512,7 @@ openerp.web.form.FieldBoolean = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$element.find('input').attr('disabled', this.readonly); + this.$element.find('input').prop('disabled', this.readonly); }, focus: function() { this.$element.find('input').focus(); @@ -1599,7 +1595,7 @@ openerp.web.form.FieldSelection = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$element.find('select').attr('disabled', this.readonly); + this.$element.find('select').prop('disabled', this.readonly); }, validate: function() { var value = this.values[this.$element.find('select')[0].selectedIndex]; @@ -1948,7 +1944,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ }, update_dom: function() { this._super.apply(this, arguments); - this.$input.attr('disabled', this.readonly); + this.$input.prop('disabled', this.readonly); } }); @@ -2905,7 +2901,7 @@ openerp.web.form.FieldBinaryFile = openerp.web.form.FieldBinary.extend({ update_dom: function() { this._super.apply(this, arguments); this.$element.find('.oe-binary-file-set, .oe-binary-file-clear').toggle(!this.readonly); - this.$element.find('input[type=text]').attr('disabled', this.readonly); + this.$element.find('input[type=text]').prop('disabled', this.readonly); }, set_value: function(value) { this._super.apply(this, arguments); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 059bc020682..bf423434ecc 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -79,6 +79,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# self.compute_aggregates(); }); + this.no_leaf = false; }, /** * Retrieves the view's number of records per page (|| section) @@ -473,6 +474,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# if (_.isEmpty(group_by) && !context['group_by_no_leaf']) { group_by = null; } + this.no_leaf = !!context['group_by_no_leaf']; this.reload_view(!!group_by, context).then( $.proxy(this, 'reload_content')); diff --git a/addons/web/static/src/js/view_page.js b/addons/web/static/src/js/view_page.js index abcfb5131dd..40ca1176c79 100644 --- a/addons/web/static/src/js/view_page.js +++ b/addons/web/static/src/js/view_page.js @@ -102,9 +102,10 @@ openerp.web.page = function (openerp) { this._super(s[2]); } }); - openerp.web.page.FieldBooleanReadonly = openerp.web.page.FieldCharReadonly.extend({ - set_value: function (value) { - this._super(value ? '\u2611' : '\u2610'); + openerp.web.page.FieldBooleanReadonly = openerp.web.form.FieldBoolean.extend({ + update_dom: function() { + this._super.apply(this, arguments); + this.$element.find('input').prop('disabled', true); } }); openerp.web.page.FieldSelectionReadonly = openerp.web.page.FieldReadonly.extend({ diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 73b0b59125e..8f5fb686e50 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -481,6 +481,10 @@ + + + this.attr('t-if', 'views.length != 1'); + @@ -567,7 +571,7 @@ - + @@ -617,6 +621,9 @@ this.removeAttr('t-if'); + + + this.removeAttr('t-if'); var $title = $(document.createElement('h3')).addClass('oe_view_title'); @@ -625,7 +632,7 @@ this.prepend($title); - @@ -1146,7 +1153,6 @@ Search Clear - Advanced Filter @@ -1160,6 +1166,7 @@ + Advanced Filter Save Filter Add to Dashboard Manage Filters diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index f5fa0387adb..ce7e877b73f 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -149,10 +149,11 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ view_mode = action_attrs.view_mode; if (action_attrs.context) { - action.context = action_attrs.context; + action.context = _.extend((action.context || {}), action_attrs.context); } if (action_attrs.domain) { - action.domain = action_attrs.domain; + action.domain = action.domain || []; + action.domain.unshift.apply(action.domain, action_attrs.domain); } var action_orig = _.extend({ flags : {} }, action); @@ -397,8 +398,8 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.Widget.extend({ this._super(parent); }, start: function() { - // TODO menu hide var self = this; + openerp.webclient.menu.do_hide_secondary(); var domain = [['application','=',true], ['state','=','installed'], ['name', '!=', 'base']]; var ds = new openerp.web.DataSetSearch(this, 'ir.module.module',{},domain); ds.read_slice(['id'], {}, function(result) { diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index 8c330434075..6cf9998fdda 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -177,19 +177,20 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ graph_data = _(graph_data).sortBy(function (point) { return point[self.abscissa] + '[[--]]' + point[self.group_field]; }); - - if (this.chart == 'bar') { - return this.schedule_bar(graph_data); + if (this.chart == 'bar' || 'line' || 'area') { + return this.schedule_bar_line_area(graph_data); } else if (this.chart == "pie") { return this.schedule_pie(graph_data); } }, - - schedule_bar: function(results) { + schedule_bar_line_area: function(results) { var self = this; - var group_list, view_chart; + var group_list, + view_chart = (self.chart == 'line')?'line':(self.chart == 'area')?'area':''; if (!this.group_field) { - view_chart = (this.orientation === 'horizontal') ? 'barH' : 'bar'; + if (self.chart == 'bar'){ + view_chart = (this.orientation === 'horizontal') ? 'barH' : 'bar'; + } group_list = _(this.columns).map(function (column, index) { return { group: column.name, @@ -202,7 +203,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ // value) and stacked bar charts (basically the same but with the // columns on top of one another instead of side by side), but it // does not handle clustered stacked bar charts - if (this.columns.length > 1) { + if (self.chart == 'bar' && (this.columns.length > 1)) { this.$element.text( 'OpenERP Web does not support combining grouping and ' + 'multiple columns in graph at this time.'); @@ -211,8 +212,10 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ } // transform series for clustered charts into series for stacked // charts - view_chart = (this.orientation === 'horizontal') - ? 'stackedBarH' : 'stackedBar'; + if (self.chart == 'bar'){ + view_chart = (this.orientation === 'horizontal') + ? 'stackedBarH' : 'stackedBar'; + } group_list = _(results).chain() .pluck(this.group_field) .uniq() @@ -253,7 +256,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ }; var x_axis, y_axis; - if (self.orientation == 'horizontal') { + if (self.chart == 'bar' && self.orientation == 'horizontal') { x_axis = ordinate_description; y_axis = abscissa_description; } else { @@ -266,11 +269,12 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ return; } self.renderer = null; - var bar_chart = new dhtmlXChart({ + var charts = new dhtmlXChart({ view: view_chart, - container: self.element_id+"-barchart", + container: self.element_id+"-"+self.chart+"chart", value:"#"+group_list[0].group+"#", - gradient: "3d", + gradient: (self.chart == "bar") ? "3d" : "light", + alpha: (self.chart == "area") ? 0.6 : 1, border: false, width: 1024, tooltip:{ @@ -278,7 +282,15 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ self.abscissa, group_list[0].text, group_list[0].group) }, radius: 0, - color:group_list[0].color, + color: (self.chart != "line") ? group_list[0].color : "", + item: (self.chart == "line") ? { + borderColor: group_list[0].color, + color: "#000000" + } : "", + line: (self.chart == "line") ? { + color: group_list[0].color, + width: 3 + } : "", origin:0, xAxis: x_axis, yAxis: y_axis, @@ -296,23 +308,32 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ } } }); + for (var m = 1; m