Browse Source

Jun 30: [FIX] Bug Fixed 'backend_theme_infinito'

16.0
Cybrosys Technologies 1 month ago
parent
commit
53941f42ef
  1. 2
      backend_theme_infinito/__manifest__.py
  2. 4
      backend_theme_infinito/controllers/base_pwa.py
  3. 21
      backend_theme_infinito/controllers/main.py
  4. 7
      backend_theme_infinito/doc/RELEASE_NOTES.md
  5. 2
      backend_theme_infinito/static/src/css/dynamic_styles.css

2
backend_theme_infinito/__manifest__.py

@ -27,7 +27,7 @@
Main Highlight Of The Theme Is You Can Dynamically Change The Colors, Main Highlight Of The Theme Is You Can Dynamically Change The Colors,
Views, Buttons, Different Types Sidebar...Etc""", Views, Buttons, Different Types Sidebar...Etc""",
"category": "Themes/Backend", "category": "Themes/Backend",
"version": "16.0.1.0.5", "version": "16.0.1.0.6",
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions',

4
backend_theme_infinito/controllers/base_pwa.py

@ -26,10 +26,6 @@ from odoo.http import request
class BasePwa(http.Controller): class BasePwa(http.Controller):
def pwa_data(self): def pwa_data(self):
# pwa_enable = request.env[
# "ir.config_parameter"].sudo().get_param(
# "base_pwa.pwa_enable")
# if pwa_enable:
return { return {
'short_name': 'Odoo', 'short_name': 'Odoo',
'name': 'Odoo-infinito', 'name': 'Odoo-infinito',

21
backend_theme_infinito/controllers/main.py

@ -84,9 +84,10 @@ class ThemeStudio(http.Controller):
def save_styles(self, changed_styles, object_class, hover=False): def save_styles(self, changed_styles, object_class, hover=False):
"""Create Dynamic Styles css file""" """Create Dynamic Styles css file"""
changed_styles = json.loads(changed_styles) changed_styles = json.loads(changed_styles)
working_dir = os.path.dirname(os.path.realpath(__file__)) file_path = get_module_resource(
working_dir = working_dir.replace('/controllers', '') 'backend_theme_infinito',
file_path = working_dir + '/static/src/css/dynamic_styles.css' 'static', 'src', 'css', 'dynamic_styles.css'
)
style_file = open(file_path, 'a') style_file = open(file_path, 'a')
if os.stat(file_path).st_size == 0: if os.stat(file_path).st_size == 0:
style_file.write('/* This file is generated automatically by ' 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") @http.route(['/theme_studio/get_current_style'], type="json")
def get_current_style(self, selector): def get_current_style(self, selector):
working_dir = os.path.dirname(os.path.realpath(__file__)) file_path = get_module_resource(
file_path = working_dir.replace('controllers', 'backend_theme_infinito',
'static/src/css/dynamic_styles.css') 'static', 'src', 'css', 'dynamic_styles.css'
)
style_file = open(file_path, 'r') style_file = open(file_path, 'r')
css = style_file.read() css = style_file.read()
css = re.sub(r'/\*[\s\S]*?\*/', "", css) css = re.sub(r'/\*[\s\S]*?\*/', "", css)
@ -132,9 +134,10 @@ class ThemeStudio(http.Controller):
@http.route(['/theme_studio/reset_to_default'], type="json") @http.route(['/theme_studio/reset_to_default'], type="json")
def reset_to_default(self): def reset_to_default(self):
working_dir = os.path.dirname(os.path.realpath(__file__)) file_path = get_module_resource(
file_path = working_dir.replace('controllers', 'backend_theme_infinito',
'static/src/css/dynamic_styles.css') 'static', 'src', 'css', 'dynamic_styles.css'
)
style_file = open(file_path, 'w') style_file = open(file_path, 'w')
style_file.write('') style_file.write('')
return True return True

7
backend_theme_infinito/doc/RELEASE_NOTES.md

@ -8,4 +8,9 @@ Initial Commit
#### 23.06.2025 #### 23.06.2025
#### Version 16.0.1.0.5 #### Version 16.0.1.0.5
#### UPDT #### UPDT
Added a general method to load file instead of os specific. 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.

2
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 {}
Loading…
Cancel
Save