|
@ -26,6 +26,7 @@ from odoo import http |
|
|
from odoo.http import request |
|
|
from odoo.http import request |
|
|
from odoo.addons.backend_theme_infinito.controllers.main import ThemeStudio |
|
|
from odoo.addons.backend_theme_infinito.controllers.main import ThemeStudio |
|
|
from odoo.addons.backend_theme_infinito.controllers.main import minify_css |
|
|
from odoo.addons.backend_theme_infinito.controllers.main import minify_css |
|
|
|
|
|
from odoo.modules.module import get_module_resource |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ThemeStudioPlus(ThemeStudio): |
|
|
class ThemeStudioPlus(ThemeStudio): |
|
@ -35,9 +36,7 @@ class ThemeStudioPlus(ThemeStudio): |
|
|
def save_styles_plus(self, new_style): |
|
|
def save_styles_plus(self, new_style): |
|
|
"""Create Dynamic Styles css file for chat box layout""" |
|
|
"""Create Dynamic Styles css file for chat box layout""" |
|
|
changed_styles = json.loads(new_style) |
|
|
changed_styles = json.loads(new_style) |
|
|
working_dir = os.path.dirname(os.path.realpath(__file__)) |
|
|
file_path = get_module_resource('backend_theme_infinito_plus', 'static', 'src', 'css', 'chatter.css') |
|
|
working_dir = working_dir.replace('/controllers', '') |
|
|
|
|
|
file_path = working_dir + '/static/src/css/chatter.css' |
|
|
|
|
|
style_file = open(file_path, 'a') |
|
|
style_file = open(file_path, 'a') |
|
|
style_file.truncate(0) |
|
|
style_file.truncate(0) |
|
|
if os.stat(file_path).st_size == 0: |
|
|
if os.stat(file_path).st_size == 0: |
|
@ -56,9 +55,7 @@ class ThemeStudioPlus(ThemeStudio): |
|
|
""" create the Dynamic css file for animation""" |
|
|
""" create the Dynamic css file for animation""" |
|
|
animated = json.loads(style) |
|
|
animated = json.loads(style) |
|
|
saved_style = animated[0] |
|
|
saved_style = animated[0] |
|
|
working_dir = os.path.dirname(os.path.realpath(__file__)) |
|
|
file_path = get_module_resource('backend_theme_infinito_plus', 'static', 'src', 'scss', 'animation.scss') |
|
|
file_path = working_dir.replace('/controllers', |
|
|
|
|
|
'/static/src/scss/animation.scss') |
|
|
|
|
|
read_file = open(file_path, 'r') |
|
|
read_file = open(file_path, 'r') |
|
|
css = read_file.read() |
|
|
css = read_file.read() |
|
|
write_file = open(file_path, 'w') |
|
|
write_file = open(file_path, 'w') |
|
@ -105,13 +102,10 @@ class ThemeStudioPlus(ThemeStudio): |
|
|
@http.route(['/theme_studio_plus/reset_to_default_style'], type="json") |
|
|
@http.route(['/theme_studio_plus/reset_to_default_style'], type="json") |
|
|
def reset_to_default_style(self): |
|
|
def reset_to_default_style(self): |
|
|
"""rest to default styles""" |
|
|
"""rest to default styles""" |
|
|
working_dir = os.path.dirname(os.path.realpath(__file__)) |
|
|
style_file_path = get_module_resource('backend_theme_infinito_plus', 'static', 'src', 'css', 'font.css') |
|
|
style_file_path = working_dir.replace('controllers', |
|
|
animation_file_path = get_module_resource('backend_theme_infinito_plus', 'static', 'src', 'scss', |
|
|
'static/src/css/font.css') |
|
|
'animation.scss') |
|
|
animation_file_path = working_dir.replace('controllers', |
|
|
chat_file_path = get_module_resource('backend_theme_infinito_plus', 'static', 'src', 'css', 'chatter.css') |
|
|
'static/src/scss/animation.scss') |
|
|
|
|
|
chat_file_path = working_dir.replace('controllers', |
|
|
|
|
|
'static/src/css/chatter.css') |
|
|
|
|
|
style_file = open(style_file_path, 'w') |
|
|
style_file = open(style_file_path, 'w') |
|
|
style_file.write('') |
|
|
style_file.write('') |
|
|
animation_read_file = open(animation_file_path, 'r') |
|
|
animation_read_file = open(animation_file_path, 'r') |
|
|