This commit is contained in:
gqh
2023-01-23 20:21:00 +08:00
parent 270b8d3cc1
commit 9c473e6f32
200 changed files with 5957 additions and 114 deletions

View File

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Powered by Kanak Infosystems LLP.
# © 2020 Kanak Infosystems LLP. (<https://www.kanakinfosystems.com>).
import base64
from odoo.http import Controller, request, route
from werkzeug.utils import redirect
DEFAULT_IMAGE = 'login_bg_img_knk/static/src/img/bg.jpg'
class DasboardBackground(Controller):
@route(['/dashboard'], type='http', auth="public")
def dashboard(self, **post):
user = request.env.user
company = user.company_id
if company.bg_image:
image = base64.b64decode(company.bg_image)
else:
return redirect(DEFAULT_IMAGE)
return request.make_response(
image, [('Content-Type', 'image')])