[ADD] Added percentage in progressbar (can't center it for the moment)

bzr revid: fme@openerp.com-20110509141001-33vihmt5edam0ydq
This commit is contained in:
Fabien Meghazi 2011-05-09 16:10:01 +02:00
parent 2e760b3699
commit 93d7852342
3 changed files with 17 additions and 1 deletions

View File

@ -648,6 +648,12 @@ body.openerp {
background-color: #F66;
border: 1px solid #D00;
}
.openerp div.oe-progressbar span {
position: absolute;
margin-left: 10px;
margin-top: 5px;
font-weight: bold;
}
/* jQuery UI override */
.openerp .ui-widget {

View File

@ -773,6 +773,14 @@ openerp.base.form.FieldProgressBar = openerp.base.form.Field.extend({
value: this.value,
disabled: this.readonly
});
},
set_value: function(value) {
this._super.apply(this, arguments);
var show_value = Number(value);
if (show_value === NaN) {
show_value = 0;
}
this.$element.find('div').progressbar('option', 'value', show_value).find('span').html(show_value + '%');
}
});

View File

@ -365,7 +365,9 @@
t-att-class="'field_' + widget.type"/>
</t>
<t t-name="FieldProgressBar">
<div t-opentag="true"></div>
<div t-opentag="true" class="oe-progressbar">
<span></span>
</div>
</t>
<t t-name="WidgetButton">
<button type="button"