From 53941f42ef2038c02c1cd116439aa30950415532 Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Mon, 30 Jun 2025 18:38:40 +0530 Subject: [PATCH] Jun 30: [FIX] Bug Fixed 'backend_theme_infinito' --- backend_theme_infinito/__manifest__.py | 2 +- .../controllers/base_pwa.py | 4 ---- backend_theme_infinito/controllers/main.py | 21 +++++++++++-------- backend_theme_infinito/doc/RELEASE_NOTES.md | 7 ++++++- .../static/src/css/dynamic_styles.css | 2 ++ 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/backend_theme_infinito/__manifest__.py b/backend_theme_infinito/__manifest__.py index 531e5d934..14cab4628 100644 --- a/backend_theme_infinito/__manifest__.py +++ b/backend_theme_infinito/__manifest__.py @@ -27,7 +27,7 @@ Main Highlight Of The Theme Is You Can Dynamically Change The Colors, Views, Buttons, Different Types Sidebar...Etc""", "category": "Themes/Backend", - "version": "16.0.1.0.5", + "version": "16.0.1.0.6", 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', diff --git a/backend_theme_infinito/controllers/base_pwa.py b/backend_theme_infinito/controllers/base_pwa.py index eb58b5966..2aaed3023 100644 --- a/backend_theme_infinito/controllers/base_pwa.py +++ b/backend_theme_infinito/controllers/base_pwa.py @@ -26,10 +26,6 @@ from odoo.http import request class BasePwa(http.Controller): def pwa_data(self): - # pwa_enable = request.env[ - # "ir.config_parameter"].sudo().get_param( - # "base_pwa.pwa_enable") - # if pwa_enable: return { 'short_name': 'Odoo', 'name': 'Odoo-infinito', diff --git a/backend_theme_infinito/controllers/main.py b/backend_theme_infinito/controllers/main.py index 852817e98..dab82d280 100644 --- a/backend_theme_infinito/controllers/main.py +++ b/backend_theme_infinito/controllers/main.py @@ -84,9 +84,10 @@ class ThemeStudio(http.Controller): def save_styles(self, changed_styles, object_class, hover=False): """Create Dynamic Styles css file""" changed_styles = json.loads(changed_styles) - working_dir = os.path.dirname(os.path.realpath(__file__)) - working_dir = working_dir.replace('/controllers', '') - file_path = working_dir + '/static/src/css/dynamic_styles.css' + file_path = get_module_resource( + 'backend_theme_infinito', + 'static', 'src', 'css', 'dynamic_styles.css' + ) style_file = open(file_path, 'a') if os.stat(file_path).st_size == 0: style_file.write('/* This file is generated automatically by ' @@ -104,9 +105,10 @@ class ThemeStudio(http.Controller): @http.route(['/theme_studio/get_current_style'], type="json") def get_current_style(self, selector): - working_dir = os.path.dirname(os.path.realpath(__file__)) - file_path = working_dir.replace('controllers', - 'static/src/css/dynamic_styles.css') + file_path = get_module_resource( + 'backend_theme_infinito', + 'static', 'src', 'css', 'dynamic_styles.css' + ) style_file = open(file_path, 'r') css = style_file.read() css = re.sub(r'/\*[\s\S]*?\*/', "", css) @@ -132,9 +134,10 @@ class ThemeStudio(http.Controller): @http.route(['/theme_studio/reset_to_default'], type="json") def reset_to_default(self): - working_dir = os.path.dirname(os.path.realpath(__file__)) - file_path = working_dir.replace('controllers', - 'static/src/css/dynamic_styles.css') + file_path = get_module_resource( + 'backend_theme_infinito', + 'static', 'src', 'css', 'dynamic_styles.css' + ) style_file = open(file_path, 'w') style_file.write('') return True diff --git a/backend_theme_infinito/doc/RELEASE_NOTES.md b/backend_theme_infinito/doc/RELEASE_NOTES.md index ab6c14a55..3eb3b29b0 100644 --- a/backend_theme_infinito/doc/RELEASE_NOTES.md +++ b/backend_theme_infinito/doc/RELEASE_NOTES.md @@ -8,4 +8,9 @@ Initial Commit #### 23.06.2025 #### Version 16.0.1.0.5 #### UPDT -Added a general method to load file instead of os specific. \ No newline at end of file +Added a general method to load file instead of os specific. + +#### 23.06.2025 +#### Version 16.0.1.0.6 +#### UPDT +Added a general method to load file instead of os specific in all route's. \ No newline at end of file diff --git a/backend_theme_infinito/static/src/css/dynamic_styles.css b/backend_theme_infinito/static/src/css/dynamic_styles.css index e69de29bb..189462a9a 100644 --- a/backend_theme_infinito/static/src/css/dynamic_styles.css +++ b/backend_theme_infinito/static/src/css/dynamic_styles.css @@ -0,0 +1,2 @@ +/* This Styles are generated automatically by Theme Studio */ + .o_statusbar_buttons {align-self: center !important;} .o_statusbar_buttons:hover {align-self: center !important;} .o_input {} .o_input:hover {} \ No newline at end of file