Browse Source

July 05: [FIX] Bug Fixed 'backend_theme_infinito'

17.0
Cybrosys Technologies 5 days ago
parent
commit
0acc992ece
  1. 2
      backend_theme_infinito/__manifest__.py
  2. 4
      backend_theme_infinito/controllers/base_pwa.py
  3. 13
      backend_theme_infinito/controllers/main.py
  4. 8
      backend_theme_infinito/doc/RELEASE_NOTES.md
  5. 1
      backend_theme_infinito/icon_hooks.py

2
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',

4
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'

13
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

8
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.
- 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.
-

1
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

Loading…
Cancel
Save