diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 0b432d0c145..1d843e7e250 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -460,6 +460,9 @@ width: 400px; text-align: left; } +.openerp .oe_button_box .oe_stat_button:hover { + background: #dddddd; +} .openerp .oe_button_box .oe_stat_button { font-weight: normal; display: inline-table; @@ -467,7 +470,8 @@ height: 45px; margin: 0px -1px -1px 0px; color: #666666; - border-color: #dddddd; + border: 1px solid #666666; + background: white; } .openerp .oe_button_box .oe_stat_button > div { display: table-cell; @@ -478,9 +482,8 @@ .openerp .oe_button_box .oe_stat_button .stat_button_icon { color: #7c7bad; font-size: 24px; - padding: 0px; + padding: 0px 3px; text-align: center; - width: 40px; } .openerp .oe_button_box .oe_stat_button svg { width: 38px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 336f583e019..cca0deb4a1f 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -432,6 +432,8 @@ $sheet-padding: 16px .oe_button_box width: 400px text-align: left + .oe_stat_button:hover + background: #ddd .oe_stat_button font-weight: normal display: inline-table @@ -439,18 +441,18 @@ $sheet-padding: 16px height: 45px margin: 0px -1px -1px 0px color: #666 - border-color: #ddd + border: 1px solid #666 + background: white > div display: table-cell vertical-align: middle text-align: left - padding: 0 + padding: 0 .stat_button_icon color: #7C7BAD font-size: 24px - padding: 0px + padding: 0px 3px text-align: center - width: 40px svg width: 38px height: 38px diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index c4bddd90f34..969e0150737 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1916,8 +1916,8 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({ template: 'WidgetButton', init: function(field_manager, node) { node.attrs.type = node.attrs['data-button-type']; - this.is_stat_button = node.attrs.class ? _.include(node.attrs.class.split(' '), 'oe_stat_button') : false; - this.icon = ""; + this.is_stat_button = /\boe_stat_button\b/.test(node.attrs['class']); + this.icon = node.attrs.icon && ""; this._super(field_manager, node); this.force_disabled = false; this.string = (this.node.attrs.string || '').replace(/_/g, ''); @@ -2845,16 +2845,12 @@ instance.web.form.FieldPercentPie = instance.web.form.AbstractField.extend({ .datum([{'x': 'value', 'y': value}, {'x': 'complement', 'y': 100 - value}]) .transition() .call(chart) - .attr('width', size) - .attr('height',size); + .attr({width:size, height:size}); d3.select(svg) .append("text") - .attr("x", size/2) - .attr("y", size/2 + 3) - .style("font-size", "10px") - .style("font-weight", "bold") - .attr("text-anchor", "middle") + .attr({x: size/2, y: size/2 + 3, 'text-anchor': 'middle'}) + .style({"font-size": "10px", "font-weight": "bold"}) .text(formatted_value); return chart; @@ -5923,7 +5919,7 @@ instance.web.form.StatInfo = instance.web.form.AbstractField.extend({ }, render_value: function() { var text = _.str.sprintf("%d %s", this.get("value") || 0, this.string); - this.$().html(QWeb.render("StatInfo", {text: text})); + this.$el.html(QWeb.render("StatInfo", {text: text})); }, }); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index b24bd8642cc..cc56dc2de13 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1189,7 +1189,7 @@ - + @@ -1356,26 +1356,15 @@ - - - - - - +