diff options
| author | David Monjoie <dmo@odoo.com> | 2017-03-21 10:35:32 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | a0b31e7df5808983ec5c85acdd2f32b67559f235 (patch) | |
| tree | 95093f4112e973d195423bb9f3c585c2edeb7a22 /addons/web/static/src/js | |
| parent | b9a2a3e320221506db3c8175d402decfc96c34ce (diff) | |
[ADD] web: add boolean button documentation
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 28 |
1 files changed, 25 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 a1847f6fb3d..28aae294dcf 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1181,6 +1181,31 @@ var LabelSelection = AbstractField.extend({ var FieldBooleanButton = AbstractField.extend({ className: 'o_stat_info', supportedFieldTypes: ['boolean'], + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * A boolean field is always set since false is a valid value. + * + * @override + */ + isSet: function () { + return true; + }, + + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * This widget is supposed to be used inside a stat button and, as such, is + * rendered the same way in edit and readonly mode. + * + * @override + * @private + */ _render: function () { this.$el.empty(); var text, hover; @@ -1213,9 +1238,6 @@ var FieldBooleanButton = AbstractField.extend({ var $hover = $('<span>').addClass('o_stat_text o_hover ' + hover_color).text(hover); this.$el.append($val).append($hover); }, - isSet: function () { - return true; - }, }); var FieldID = InputField.extend({ |
