diff --git a/backend_theme_infinito/__manifest__.py b/backend_theme_infinito/__manifest__.py index a7db18b3e..531e5d934 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.4", + "version": "16.0.1.0.5", 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', diff --git a/backend_theme_infinito/controllers/main.py b/backend_theme_infinito/controllers/main.py index 599b5dd39..852817e98 100644 --- a/backend_theme_infinito/controllers/main.py +++ b/backend_theme_infinito/controllers/main.py @@ -26,6 +26,8 @@ import re from odoo import http from odoo.http import request +from odoo.modules.module import get_module_resource + def minify_css(path): """Minify css string""" @@ -223,10 +225,10 @@ class ThemeStudio(http.Controller): @http.route(['/theme_studio/get_presets'], type="json") def get_presets(self): - working_dir = os.path.dirname(os.path.realpath(__file__)) - working_dir = working_dir.replace('/controllers', '') - file_path = working_dir + '/static/src/json/presets.json' + file_path = get_module_resource( + 'backend_theme_infinito', + 'static', 'src', 'json', 'presets.json' + ) file = open(file_path, 'r') presets = json.load(file) - return presets diff --git a/backend_theme_infinito/doc/RELEASE_NOTES.md b/backend_theme_infinito/doc/RELEASE_NOTES.md index 10d6b40b0..ab6c14a55 100644 --- a/backend_theme_infinito/doc/RELEASE_NOTES.md +++ b/backend_theme_infinito/doc/RELEASE_NOTES.md @@ -5,3 +5,7 @@ #### ADD 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