add backend_theme from openworx.nl

This commit is contained in:
santiky 2021-08-07 14:02:32 +02:00
parent 17ecc2e4a0
commit 46d66821ec
Signed by: snt
GPG key ID: A9FD34930EADBE71
70 changed files with 5413 additions and 0 deletions

View file

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import main

View file

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Copyright 2016, 2019 Openworx
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import base64
from odoo.http import Controller, request, route
from werkzeug.utils import redirect
DEFAULT_IMAGE = '/backend_theme_v12/static/src/img/material-background.jpg'
class DasboardBackground(Controller):
@route(['/dashboard'], type='http', auth='user', website=False)
def dashboard(self, **post):
user = request.env.user
company = user.company_id
if company.dashboard_background:
image = base64.b64decode(company.dashboard_background)
else:
return redirect(DEFAULT_IMAGE)
return request.make_response(
image, [('Content-Type', 'image')])