'Create aliases for existing rows.'

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

    super(AliasMixin, self)._init_column(name)
    if (name != 'alias_id'):
        return
    alias_ctx = {'alias_model_name': self.get_alias_model_name({}), 'alias_parent_model_name': self._name}
    alias_model = self.env['mail.alias'].sudo().with_context(alias_ctx).browse([])
    child_ctx = {'active_test': False, 'prefetch_fields': False}
    child_model = self.sudo().with_context(child_ctx).browse([])
    for record in child_model.search([('alias_id', '=', False)]):
        alias = alias_model.create(record.get_alias_values())
        record.with_context({'mail_notrack': True}).alias_id = alias
        _logger.info('Mail    alias    created    for    %s    %s    (id    %s)', record._name, record.display_name, record.id)
