'Computes:
- message_subtype_data: data about document subtypes: which are
available, which are followed if any'

@http.route('/mail/read_subscription_data', type='json', auth='user')
def read_subscription_data(self, res_model, follower_id):

    followers = request.env['mail.followers'].browse(follower_id)
    subtypes = request.env['mail.message.subtype'].search(['&', ('hidden', '=', False), '|', ('res_model', '=', res_model), ('res_model', '=', False)])
    subtypes_list = [{'name': subtype.name, 'res_model': subtype.res_model, 'sequence': subtype.sequence, 'default': subtype.default, 'internal': subtype.internal, 'followed': (subtype.id in followers.mapped('subtype_ids').ids), 'parent_model': ((subtype.parent_id and subtype.parent_id.res_model) or False), 'id': subtype.id} for subtype in subtypes]
    subtypes_list = sorted(subtypes_list, key=itemgetter('parent_model', 'res_model', 'internal', 'sequence'))
    return subtypes_list
