addons14/storage_file/models/storage_file.py
def _get_url(self):
        """Retrieve file URL based on backend params."""
        backend = self.backend_id.sudo()
        parts = []
        if backend.served_by == "odoo":
            params = self.env["ir.config_parameter"].sudo()
            parts = [
                params.get_param("web.base.url"),
                "storage.file",
                self._slugify_name_with_id(),
            ]
        else:
            parts = [backend.base_url or ""]
            if backend.url_include_directory_path and backend.directory_path:
                parts.append(backend.directory_path)
            parts.append(self.relative_path or "")
        return "/".join(parts)
Retrieve file URL based on backend params.
Retrieve file URL based on backend params.
Retrieve file URL based on backend params .
def _get_url(self):
        backend = self.backend_id.sudo()
        parts = []
        if backend.served_by == "odoo":
            params = self.env["ir.config_parameter"].sudo()
            parts = [
                params.get_param("web.base.url"),
                "storage.file",
                self._slugify_name_with_id(),
            ]
        else:
            parts = [backend.base_url or ""]
            if backend.url_include_directory_path and backend.directory_path:
                parts.append(backend.directory_path)
            parts.append(self.relative_path or "")
        return "/".join(parts)
def _get_url ( self ) : backend = self . backend_id . sudo ( ) parts = [ ] if backend . served_by == "odoo" : params = self . env [ "ir.config_parameter" ] . sudo ( ) parts = [ params . get_param ( "web.base.url" ) , "storage.file" , self . _slugify_name_with_id ( ) , ] else : parts = [ backend . base_url or "" ] if backend . url_include_directory_path and backend . directory_path : parts . append ( backend . directory_path ) parts . append ( self . relative_path or "" ) return "/" . join ( parts )
Retrieve file URL based on backend params.
Retrieve file URL based on backend params .
"""Retrieve file URL based on backend params."""
self