odoo-13.0/addons/web/static/src/js/fields/field_utils.js
/**
 * @todo Really? it returns a jQuery element...  We should try to avoid this and
 * let DOM utility functions handle this directly. And replace this with a
 * function that returns a string so we can get rid of the forceString.
 *
 * @param {boolean} value
 * @param {Object} [field]
 *        a description of the field (note: this parameter is ignored)
 * @param {Object} [options] additional options
 * @param {boolean} [options.forceString=false] if true, returns a string
*    representation of the boolean rather than a jQueryElement
 * @returns {jQuery|string}
 */
@todo Really. it returns a jQuery element...  We should try to avoid this and
let DOM utility functions handle this directly. And replace this with a
function that returns a string so we can get rid of the forceString.


@todo Really . it returns a jQuery element ... We should try to avoid this and let DOM utility functions handle this directly . And replace this with a function that returns a string so we can get rid of the forceString .
function formatBoolean(value, field, options) {
    if (options && options.forceString) {
        return value ? _t('True') : _t('False');
    }
    return dom.renderCheckbox({
        prop: {
            checked: value,
            disabled: true,
        },
    });
}
function formatBoolean ( value , field , options ) { if ( options && options . forceString ) { return value ? _t ( 'True' ) : _t ( 'False' ) ; } return dom . renderCheckbox ( { prop : { checked : value , disabled : true , } , } ) ; }
@todo Really?
@todo Really?