diff --git a/backend_theme_infinito/__manifest__.py b/backend_theme_infinito/__manifest__.py index 9748f7e44..fa5f7177e 100755 --- 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": "17.0.1.0.2", + "version": "17.0.1.0.3", '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 da05c483e..5bbad0d84 100755 --- a/backend_theme_infinito/controllers/base_pwa.py +++ b/backend_theme_infinito/controllers/base_pwa.py @@ -23,6 +23,7 @@ import json from odoo import http from odoo.http import request +from odoo.modules.module import get_module_resource class BasePwa(http.Controller): """ @@ -36,13 +37,14 @@ class BasePwa(http.Controller): Returns: dict: Dictionary containing PWA manifest data. """ + src = get_module_resource('backend_theme_infinito', 'static', 'src', 'img', 'menu.png') return { 'short_name': 'Odoo', 'name': 'Odoo-infinito', 'description': 'PWA provided by backend theme infinito', 'icons': [ { - 'src': '/backend_theme_infinito/static/src/img/menu.png', + 'src': f'{src}', 'type': 'image/png', 'sizes': '144x144', 'purpose': 'any maskable' diff --git a/backend_theme_infinito/controllers/main.py b/backend_theme_infinito/controllers/main.py index d78da1921..db615447a 100755 --- a/backend_theme_infinito/controllers/main.py +++ b/backend_theme_infinito/controllers/main.py @@ -139,11 +139,8 @@ class ThemeStudio(http.Controller): changed_styles_str = kwargs.get('changed_styles', '{}') object_class = kwargs.get('object_class', '') changed_styles = json.loads(changed_styles_str) - 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 ' 'Theme Infinito */\n') @@ -193,9 +190,7 @@ class ThemeStudio(http.Controller): ``` """ selector = kwargs.get('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) @@ -241,9 +236,7 @@ class ThemeStudio(http.Controller): reset_to_default() ``` """ - 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 af4ad11a3..c67e0dc26 100755 --- a/backend_theme_infinito/doc/RELEASE_NOTES.md +++ b/backend_theme_infinito/doc/RELEASE_NOTES.md @@ -13,4 +13,10 @@ Initial Commit for Infinito Backend Theme #### 23.06.2025 #### Version 17.0.1.0.2 ##### BUGFIX -- Updated the functionality to fetch the module resource. \ No newline at end of file +- Updated the functionality to fetch the module resource. + +#### 05.07.2025 +#### Version 17.0.1.0.3 +##### BUGFIX +- Updated the functionality to fetch the module resource. +- \ No newline at end of file diff --git a/backend_theme_infinito/icon_hooks.py b/backend_theme_infinito/icon_hooks.py index b48da6aec..ea95344e2 100755 --- a/backend_theme_infinito/icon_hooks.py +++ b/backend_theme_infinito/icon_hooks.py @@ -22,7 +22,6 @@ ############################################################################# import base64 -from odoo import api, SUPERUSER_ID from odoo.modules import get_module_resource