diff options
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index e5950a5623d..c16020b4b65 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1345,6 +1345,32 @@ var FieldBooleanButton = AbstractField.extend({ var StatInfo = AbstractField.extend({ supportedFieldTypes: ['integer', 'float'], + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * StatInfo widgets are always set since they basically only display info. + * + * @override + */ + isSet: function () { + return true; + }, + + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * Renders the field value using the StatInfo template. The text part of the + * widget is either the string attribute of this node in the view or the + * label of the field itself if no string attribute is given. + * + * @override + * @private + */ _render: function () { var options = { value: this.value || 0, @@ -1359,9 +1385,6 @@ var StatInfo = AbstractField.extend({ this.$el.html(qweb.render("StatInfo", options)); this.$el.addClass('o_stat_info'); }, - isSet: function () { - return true; - }, }); var FieldPercentPie = AbstractField.extend({ |
