Browse Source

July 02: [FIX] Bug Fixed 'backend_theme_infinito_plus'

pull/380/merge
Cybrosys Technologies 1 week ago
parent
commit
3b86c9141e
  1. 2
      backend_theme_infinito_plus/__manifest__.py
  2. 19
      backend_theme_infinito_plus/controllers/main.py
  3. 5
      backend_theme_infinito_plus/doc/RELEASE_NOTES.md
  4. 8
      backend_theme_infinito_plus/models/add_google_fonts.py
  5. 4
      backend_theme_infinito_plus/static/src/css/chatter.css
  6. 55
      backend_theme_infinito_plus/static/src/css/font.css
  7. 49
      backend_theme_infinito_plus/static/src/scss/animation.scss

2
backend_theme_infinito_plus/__manifest__.py

@ -27,7 +27,7 @@
With Odoo.Main Highlight Of The Theme Is You Can Dynamically With Odoo.Main Highlight Of The Theme Is You Can Dynamically
Change The Fonts,Animations, Languages,Chatbox Layouts...Etc""", Change The Fonts,Animations, Languages,Chatbox Layouts...Etc""",
'category': "Themes/Backend", 'category': "Themes/Backend",
'version': "16.0.1.0.0", 'version': "16.0.1.0.1",
'author': 'Cybrosys Techno Solutions', 'author': 'Cybrosys Techno Solutions',
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions',

19
backend_theme_infinito_plus/controllers/main.py

@ -24,6 +24,7 @@ import os
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
from odoo import http from odoo import http
from odoo.http import request from odoo.http import request
@ -36,9 +37,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:
@ -57,9 +56,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')
@ -101,13 +98,9 @@ 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', 'animation.scss')
'static/src/css/font.css') chat_file_path = get_module_resource('backend_theme_infinito_plus', 'static', 'src', 'css', 'chatter.css')
animation_file_path = working_dir.replace('controllers',
'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_file = open(animation_file_path, 'w') animation_file = open(animation_file_path, 'w')

5
backend_theme_infinito_plus/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 16.0.1.0.0 #### Version 16.0.1.0.0
#### ADD #### ADD
- Initial Commit for Infinito Plus Backend Theme - Initial Commit for Infinito Plus Backend Theme
#### 30.06.2025
#### Version 16.0.1.0.1
#### UPDT
- Changed how files are accessed in controller's and model's, used a generalised method to fetch the files.

8
backend_theme_infinito_plus/models/add_google_fonts.py

@ -23,6 +23,8 @@ import os
import requests import requests
from odoo.modules.module import get_module_resource
from odoo import api, fields, models, _ from odoo import api, fields, models, _
from odoo.exceptions import ValidationError from odoo.exceptions import ValidationError
@ -65,8 +67,7 @@ class GoogleFont(models.Model):
def set_css(self): def set_css(self):
"""open the file write the style in to the css file""" """open the file write the style in to the css file"""
working_dir = os.path.dirname(os.path.realpath(__file__)) working_dir = get_module_resource('backend_theme_infinito_plus', 'static', 'src', 'css', 'font.css')
working_dir = working_dir.replace('/models', '/static/src/css/font.css')
# open the file in write mode # open the file in write mode
with open(working_dir, 'w') as file: with open(working_dir, 'w') as file:
style = f""" style = f"""
@ -84,7 +85,6 @@ class GoogleFont(models.Model):
@staticmethod @staticmethod
def remove_fonts(): def remove_fonts():
"""remove the style when changing the font""" """remove the style when changing the font"""
working_dir = os.path.dirname(os.path.realpath(__file__)) working_dir = get_module_resource('backend_theme_infinito_plus', 'static', 'src', 'css', 'font.css')
working_dir = working_dir.replace('/models', '/static/src/css/font.css')
with open(working_dir, 'w') as file: with open(working_dir, 'w') as file:
file.write('') file.write('')

4
backend_theme_infinito_plus/static/src/css/chatter.css

@ -1,2 +1,2 @@
/* This Styles are generated automatically by Theme Studio */ /* This file is generated automatically by Theme Infinito Plus */
.o_ChatWindow {top:10px !important;left:10px !important;right:auto !important;} .o_ChatWindow {

55
backend_theme_infinito_plus/static/src/css/font.css

@ -1,55 +0,0 @@
/* This Styles are generated automatically by Theme Studio */
/* cyrillic-ext */
@font-face {
font-family: 'Rubik Iso';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/rubikiso/v2/x3dickHUfr-S4VAI4sAxdvoDjy8.woff2) format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
font-family: 'Rubik Iso';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/rubikiso/v2/x3dickHUfr-S4VAI4sAxf_oDjy8.woff2) format('woff2');
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* hebrew */
@font-face {
font-family: 'Rubik Iso';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/rubikiso/v2/x3dickHUfr-S4VAI4sAxefoDjy8.woff2) format('woff2');
unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* latin-ext */
@font-face {
font-family: 'Rubik Iso';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/rubikiso/v2/x3dickHUfr-S4VAI4sAxdfoDjy8.woff2) format('woff2');
unicode-range: U+0100-02AF, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Rubik Iso';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url(https://fonts.gstatic.com/s/rubikiso/v2/x3dickHUfr-S4VAI4sAxe_oD.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* {
font-family: 'Rubik Iso' !important;
}
.fa {
font: normal normal normal 14px/1 FontAwesome !important;}
.oi {
font-family: 'odoo_ui_icons' !important;}

49
backend_theme_infinito_plus/static/src/scss/animation.scss

@ -1,49 +0,0 @@
.o_kanban_view {
.oe_kanban_card, .o_kanban_record {
@for $tr from 1 through 80 {
&:nth-child(#{$tr}) {
animation:infinito_kanban_shake #{$tr * .1}s ease-in !important;
}
}
}
}
@keyframes infinito_kanban_slide_in {
0% { transform: translateX(-100%); }
100% { transform: translateX(0); }
}
@keyframes infinito_kanban_scale {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}
@keyframes infinito_kanban_shake {
0% {
transform: rotate(-5deg);
opacity: 0;
}
20% {
transform: rotate(5deg);
}
40% {
transform: rotate(-3deg);
}
60% {
transform: rotate(3deg);
}
80% {
transform: rotate(-1deg);
}
90% {
transform: rotate(1deg);
}
100% {
transform: rotate(0deg);
opacity: 1;
}
}
Loading…
Cancel
Save