add backend_theme from openworx.nl
This commit is contained in:
parent
17ecc2e4a0
commit
46d66821ec
70 changed files with 5413 additions and 0 deletions
2
backend_theme_v12/controllers/__init__.py
Normal file
2
backend_theme_v12/controllers/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from . import main
|
23
backend_theme_v12/controllers/main.py
Normal file
23
backend_theme_v12/controllers/main.py
Normal 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')])
|
Loading…
Add table
Add a link
Reference in a new issue