17 lines
632 B
Python
17 lines
632 B
Python
import base64
|
|
from odoo import http
|
|
from odoo.http import request
|
|
|
|
class IntroLoaderController(http.Controller):
|
|
|
|
@http.route('/intro_loader/image', type='http', auth="none")
|
|
def intro_loader_image(self, **kwargs):
|
|
# Fetch image from config
|
|
img_b64 = request.env['ir.config_parameter'].sudo().get_param('intro_loader.image_data')
|
|
|
|
if not img_b64:
|
|
return request.redirect('/expert_theme/static/src/img/logo.webp')
|
|
|
|
image_data = base64.b64decode(img_b64)
|
|
headers = [('Content-Type', 'image/png')]
|
|
return request.make_response(image_data, headers) |