Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: eLearning

Entity: slide.slide.resource

Compute Method: _compute_download_url

Inputs Method Outputs
for resource in self:
            extension = get_extension(resource.file_name) if resource.file_name else ''
            if not resource.name:
                resource.download_url = False
                continue
            file_name = resource.name if resource.name.endswith(extension) else resource.name + extension
            resource.download_url = f'/web/content/slide.slide.resource/{resource.id}/data?' + url_encode({
                'download': 'true',
                'filename': file_name,
            })

Back to entity