summaryrefslogtreecommitdiff
path: root/backend_theme_v14/controllers
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 17:14:58 +0700
commit1ca3b3df3421961caec3b747a364071c80f5c7da (patch)
tree6778a1f0f3f9b4c6e26d6d87ccde16e24da6c9d6 /backend_theme_v14/controllers
parentb57188be371d36d96caac4b8d65a40745c0e972c (diff)
initial commit
Diffstat (limited to 'backend_theme_v14/controllers')
-rw-r--r--backend_theme_v14/controllers/__init__.py2
-rw-r--r--backend_theme_v14/controllers/main.py23
2 files changed, 25 insertions, 0 deletions
diff --git a/backend_theme_v14/controllers/__init__.py b/backend_theme_v14/controllers/__init__.py
new file mode 100644
index 0000000..cd4d6a8
--- /dev/null
+++ b/backend_theme_v14/controllers/__init__.py
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+from . import main \ No newline at end of file
diff --git a/backend_theme_v14/controllers/main.py b/backend_theme_v14/controllers/main.py
new file mode 100644
index 0000000..9b586a3
--- /dev/null
+++ b/backend_theme_v14/controllers/main.py
@@ -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_v14/static/src/img/material-background.png'
+
+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')])