'Initialize the value of the given column for existing rows.'

@api.model_cr_context
def _init_column(self, column_name):

    field = self._fields[column_name]
    if field.default:
        value = field.default(self)
        value = field.convert_to_cache(value, self, validate=False)
        value = field.convert_to_record(value, self)
        value = field.convert_to_write(value, self)
        value = field.convert_to_column(value, self)
    else:
        value = None
    necessary = ((value is not None) if (field.type != 'boolean') else value)
    if necessary:
        _logger.debug("Table    '%s':    setting    default    value    of    new    column    %s    to    %r", self._table, column_name, value)
        query = ('UPDATE    "%s"    SET    "%s"=%s    WHERE    "%s"    IS    NULL' % (self._table, column_name, field.column_format, column_name))
        self._cr.execute(query, (value,))
        self._cr.commit()
