@ -0,0 +1,41 @@ |
|||||
|
Backend Theme Infinito |
||||
|
======================= |
||||
|
* Backend Theme Infinito module for Odoo 16 community editions |
||||
|
|
||||
|
Installation |
||||
|
============ |
||||
|
- www.odoo.com/documentation/16.0/setup/install.html |
||||
|
- Install our custom addon |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* 'Cybrosys Techno Solutions <https://cybrosys.com/>'__ |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* 'Cybrosys Techno Solutions <https://cybrosys.com/>'__ |
||||
|
Author : Farseen, Musthafa @Cybrosys |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit https://www.cybrosys.com |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
||||
|
|
@ -0,0 +1,24 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from .icon_hooks import icons_post_init_hook |
||||
|
from . import controllers |
||||
|
from . import models |
@ -0,0 +1,96 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
"name": "Infinito Backend Theme", |
||||
|
"description": """Utmost and dynamic backend theme for Odoo 16""", |
||||
|
"summary": """The Backend Theme Infinito Is A Dynamic And Ultimate Theme |
||||
|
For Your Odoo V16. This Theme Will Give You A New Experience With Odoo. |
||||
|
Main Highlight Of The Theme Is You Can Dynamically Change The Colors, |
||||
|
Views, Buttons, Different Types Sidebar...Etc""", |
||||
|
"category": "Themes/Backend", |
||||
|
"version": "16.0.1.0.0", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': "https://www.cybrosys.com", |
||||
|
"depends": ['web', 'mail'], |
||||
|
"data": [ |
||||
|
'views/assets.xml', |
||||
|
'views/layout.xml', |
||||
|
'views/base_pwa.xml', |
||||
|
'views/icons.xml', |
||||
|
], |
||||
|
'assets': { |
||||
|
'web._assets_primary_variables': { |
||||
|
'backend_theme_infinito/static/src/scss/theme_variables.scss', |
||||
|
}, |
||||
|
'web.assets_backend': { |
||||
|
'/backend_theme_infinito/static/src/xml/systray.xml', |
||||
|
'/backend_theme_infinito/static/src/xml/views.xml', |
||||
|
'/backend_theme_infinito/static/src/xml/theme_editor.xml', |
||||
|
'/backend_theme_infinito/static/src/xml/studio_elements.xml', |
||||
|
'/backend_theme_infinito/static/src/xml/ThemeStudioMenu.xml', |
||||
|
'/backend_theme_infinito/static/src/xml/style_add.xml', |
||||
|
'/backend_theme_infinito/static/src/xml/sidebar.xml', |
||||
|
'/backend_theme_infinito/static/src/xml/MenuBookmark.xml', |
||||
|
|
||||
|
'https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap', |
||||
|
'/backend_theme_infinito/static/src/css/style.css', |
||||
|
'/backend_theme_infinito/static/src/css/loaders.css', |
||||
|
'backend_theme_infinito/static/src/scss/sidebar.scss', |
||||
|
'backend_theme_infinito/static/src/scss/responsive.scss', |
||||
|
'backend_theme_infinito/static/src/scss/theme_date_picker.scss', |
||||
|
'backend_theme_infinito/static/src/scss/theme_styles.scss', |
||||
|
'backend_theme_infinito/static/src/scss/theme_rtl.scss', |
||||
|
'backend_theme_infinito/static/src/scss/app_menu.scss', |
||||
|
'backend_theme_infinito/static/src/scss/extra_styles.scss', |
||||
|
'backend_theme_infinito/static/src/scss/views.scss', |
||||
|
'/backend_theme_infinito/static/src/js/systray.js', |
||||
|
'/backend_theme_infinito/static/src/js/loaders.js', |
||||
|
'/backend_theme_infinito/static/src/js/theme_editor.js', |
||||
|
'/backend_theme_infinito/static/src/js/ThemeStudioWidget.js', |
||||
|
'/backend_theme_infinito/static/src/js/Tool.js', |
||||
|
'/backend_theme_infinito/static/src/js/VisualEditor.js', |
||||
|
'/backend_theme_infinito/static/src/js/change.js', |
||||
|
'/backend_theme_infinito/static/src/js/style_add.js', |
||||
|
'/backend_theme_infinito/static/src/js/sidebar.js', |
||||
|
'/backend_theme_infinito/static/src/js/navbar.js', |
||||
|
'/backend_theme_infinito/static/src/js/theme_editor_sidebar.js', |
||||
|
'/backend_theme_infinito/static/src/js/recentApps.js', |
||||
|
'/backend_theme_infinito/static/src/js/timepicker.js', |
||||
|
'/backend_theme_infinito/static/src/js/MenuBookmark.js', |
||||
|
'/backend_theme_infinito/static/src/js/AdvancedFeautres.js', |
||||
|
'/backend_theme_infinito/static/src/js/theme_studio_action.js', |
||||
|
'/backend_theme_infinito/static/src/js/ThemeStudioMenu.js', |
||||
|
'/backend_theme_infinito/static/src/js/variables.js', |
||||
|
}, |
||||
|
}, |
||||
|
'post_init_hook': 'icons_post_init_hook', |
||||
|
'images': [ |
||||
|
'static/description/banner.png', |
||||
|
'static/description/theme_screenshot.png', |
||||
|
], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'application': False, |
||||
|
'auto_install': False, |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import main |
||||
|
from . import base_pwa |
@ -0,0 +1,55 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
import json |
||||
|
from odoo import http |
||||
|
from odoo.http import request |
||||
|
|
||||
|
|
||||
|
class BasePwa(http.Controller): |
||||
|
def pwa_data(self): |
||||
|
# pwa_enable = request.env[ |
||||
|
# "ir.config_parameter"].sudo().get_param( |
||||
|
# "base_pwa.pwa_enable") |
||||
|
# if pwa_enable: |
||||
|
return { |
||||
|
'short_name': 'Odoo', |
||||
|
'name': 'Odoo-infinito', |
||||
|
'description': 'PWA provided by backend theme infinito', |
||||
|
'icons': [ |
||||
|
{ |
||||
|
'src': '/backend_theme_infinito/static/src/img/menu.png', |
||||
|
'type': 'image/png', |
||||
|
'sizes': '144x144', |
||||
|
'purpose': 'any maskable' |
||||
|
}, |
||||
|
], |
||||
|
'start_url': 'http://cybrosys:8015/web', |
||||
|
'background_color': 'white', |
||||
|
'display': 'standalone', |
||||
|
'theme_color': 'white', |
||||
|
} |
||||
|
|
||||
|
@http.route('/manifest/webmanifest', type='http', |
||||
|
auth='public', website=True, sitemap=False) |
||||
|
def base_pwa_data(self): |
||||
|
return request.make_response(json.dumps(self.pwa_data()), |
||||
|
headers=[('Content-Type', 'application/json;charset=utf-8')]) |
@ -0,0 +1,232 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
import json |
||||
|
import os |
||||
|
import re |
||||
|
|
||||
|
from odoo import http |
||||
|
from odoo.http import request |
||||
|
|
||||
|
|
||||
|
def minify_css(path): |
||||
|
"""Minify css string""" |
||||
|
with open(path, 'r') as f: |
||||
|
css = f.read() |
||||
|
css = re.sub(r'/\*[\s\S]*?\*/', "", css) |
||||
|
css = re.sub(r'url\((["\'])([^)]*)\1\)', r'url(\2)', css) |
||||
|
css = re.sub(r'\s+', ' ', css) |
||||
|
css = re.sub(r'#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3(\s|;)', r'#\1\2\3\4', |
||||
|
css) |
||||
|
css = re.sub(r':\s*0(\.\d+([cm]m|e[mx]|in|p[ctx]))\s*;', r':\1;', css) |
||||
|
rules = re.findall(r'([^{]+){([^}]*)}', css) |
||||
|
selectors_list = [] |
||||
|
css_values = {} |
||||
|
for rule in rules: |
||||
|
selector = rule[0] |
||||
|
content = rule[1] |
||||
|
if selector not in selectors_list: |
||||
|
selectors_list.append(selector) |
||||
|
css_values[selector] = content |
||||
|
else: |
||||
|
css_values[selector] = css_values[selector] + content |
||||
|
with open(path, 'w') as f: |
||||
|
selector_dict = {} |
||||
|
for selector in selectors_list: |
||||
|
rule = css_values[selector].split(';') |
||||
|
dict_rule = {} |
||||
|
for r in rule: |
||||
|
if r: |
||||
|
split_rule = r.split(':') |
||||
|
if len(split_rule) == 2: |
||||
|
dict_rule[split_rule[0].strip()] = split_rule[1] |
||||
|
selector_dict[selector] = dict_rule |
||||
|
f.write('/* This Styles are generated automatically by Theme Studio' |
||||
|
' */\n') |
||||
|
for selector in selector_dict: |
||||
|
f.write(selector + '{') |
||||
|
for rule_data in selector_dict[selector]: |
||||
|
if rule_data != 'pointer-events': |
||||
|
if selector_dict[selector][rule_data].find( |
||||
|
'!important') == -1: |
||||
|
f.write(rule_data + ':' + |
||||
|
selector_dict[selector][rule_data] + |
||||
|
' !important;') |
||||
|
else: |
||||
|
f.write(rule_data + ':' + |
||||
|
selector_dict[selector][rule_data] + ';') |
||||
|
f.write('}') |
||||
|
|
||||
|
|
||||
|
class ThemeStudio(http.Controller): |
||||
|
|
||||
|
@http.route(['/theme_studio/save_styles'], type="json") |
||||
|
def save_styles(self, changed_styles, object_class, hover=False): |
||||
|
"""Create Dynamic Styles css file""" |
||||
|
changed_styles = json.loads(changed_styles) |
||||
|
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' |
||||
|
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') |
||||
|
|
||||
|
style_file.write('\n.' + object_class + ':hover {\n') if hover else \ |
||||
|
style_file.write('\n.' + object_class + ' {\n') |
||||
|
for style in changed_styles: |
||||
|
style_file.write( |
||||
|
'\t' + style + ': ' + changed_styles[style] + ';\n') |
||||
|
style_file.write('}\n') |
||||
|
style_file.close() |
||||
|
minify_css(file_path) |
||||
|
return True |
||||
|
|
||||
|
@http.route(['/theme_studio/get_current_style'], type="json") |
||||
|
def get_current_style(self, selector): |
||||
|
working_dir = os.path.dirname(os.path.realpath(__file__)) |
||||
|
file_path = working_dir.replace('controllers', |
||||
|
'static/src/css/dynamic_styles.css') |
||||
|
style_file = open(file_path, 'r') |
||||
|
css = style_file.read() |
||||
|
css = re.sub(r'/\*[\s\S]*?\*/', "", css) |
||||
|
css = re.sub(r'url\((["\'])([^)]*)\1\)', r'url(\2)', css) |
||||
|
css = re.sub(r'\s+', ' ', css) |
||||
|
css = re.sub(r'#([0-9a-f])\1([\da-f])\2([0-9a-f])\3(\s|;)', |
||||
|
r'#\1\2\3\4', css) |
||||
|
css = re.sub(r':\s*0(\.\d+([cm]m|e[mx]|in|p[ctx]))\s*;', r':\1;', css) |
||||
|
rules = re.findall(r'([^{]+){([^}]*)}', css) |
||||
|
for rule in rules: |
||||
|
selector_now = rule[0] |
||||
|
content = rule[1] |
||||
|
if selector == selector_now.strip(): |
||||
|
contents = content.split(';') |
||||
|
content = [] |
||||
|
for c in contents: |
||||
|
c = c.split(':') |
||||
|
if c[0] != '' and len(c) > 1: |
||||
|
content.append([c[0], c[1].strip().replace('!important', '')]) |
||||
|
return content |
||||
|
|
||||
|
return False |
||||
|
|
||||
|
@http.route(['/theme_studio/reset_to_default'], type="json") |
||||
|
def reset_to_default(self): |
||||
|
working_dir = os.path.dirname(os.path.realpath(__file__)) |
||||
|
file_path = working_dir.replace('controllers', |
||||
|
'static/src/css/dynamic_styles.css') |
||||
|
style_file = open(file_path, 'w') |
||||
|
style_file.write('') |
||||
|
return True |
||||
|
|
||||
|
@http.route(['/theme_studio/set_advanced_data'], type="json") |
||||
|
def set_advanced_data(self, vals): |
||||
|
set_param = request.env['ir.config_parameter'].sudo().set_param |
||||
|
set_param('backend_theme_infinito.is_user_edit', vals['userEdit']) |
||||
|
set_param('backend_theme_infinito.is_sidebar_enabled', vals['sidebar']) |
||||
|
set_param('backend_theme_infinito.is_fullscreen_enabled', vals['fullscreen']) |
||||
|
set_param('backend_theme_infinito.is_sidebar_icon', vals['sidebarIcon']) |
||||
|
set_param('backend_theme_infinito.is_sidebar_name', vals['sidebarName']) |
||||
|
set_param('backend_theme_infinito.is_sidebar_company', vals['sidebarCompany']) |
||||
|
set_param('backend_theme_infinito.is_sidebar_user', vals['sidebarUser']) |
||||
|
set_param('backend_theme_infinito.is_recent_apps', vals['recentApps']) |
||||
|
set_param('backend_theme_infinito.is_fullscreen_app', vals['fullScreenApp']) |
||||
|
set_param('backend_theme_infinito.is_rtl', vals['infinitoRtl']) |
||||
|
set_param('backend_theme_infinito.is_dark', vals['infinitoDark']) |
||||
|
set_param('backend_theme_infinito.dark_mode', vals['infinitoDarkMode']) |
||||
|
set_param('backend_theme_infinito.dark_start', vals['infinitoDarkStart']) |
||||
|
set_param('backend_theme_infinito.dark_end', vals['infinitoDarkEnd']) |
||||
|
set_param('backend_theme_infinito.is_menu_bookmark', vals['infinitoBookmark']) |
||||
|
set_param('backend_theme_infinito.is_chameleon', vals['infinitoChameleon']) |
||||
|
|
||||
|
@http.route(['/theme_studio/set_advanced_data_user'], type="json") |
||||
|
def set_advanced_data_user(self, vals): |
||||
|
request.env.user.write({ |
||||
|
'is_sidebar_enabled': vals['sidebar'], |
||||
|
'is_fullscreen_enabled': vals['fullscreen'], |
||||
|
'is_sidebar_icon': vals['sidebarIcon'], |
||||
|
'is_sidebar_name': vals['sidebarName'], |
||||
|
'is_sidebar_company': vals['sidebarCompany'], |
||||
|
'is_sidebar_user': vals['sidebarUser'], |
||||
|
'is_recent_apps': vals['recentApps'], |
||||
|
'is_fullscreen_app': vals['fullScreenApp'], |
||||
|
'is_rtl': vals['infinitoRtl'], |
||||
|
'is_dark': vals['infinitoDark'], |
||||
|
'dark_mode': vals['infinitoDarkMode'], |
||||
|
'dark_start': vals['infinitoDarkStart'], |
||||
|
'dark_end': vals['infinitoDarkEnd'], |
||||
|
'is_menu_bookmark': vals['infinitoBookmark'], |
||||
|
'loader_class': vals['loaderClass'], |
||||
|
'is_chameleon': vals['infinitoChameleon'], |
||||
|
}) |
||||
|
|
||||
|
return True |
||||
|
|
||||
|
@http.route(['/theme_studio/add_recent_app'], type="json") |
||||
|
def add_recent_app(self, app): |
||||
|
recent_app = request.env['recent.apps'].sudo() |
||||
|
exist = recent_app.search([ |
||||
|
('app_id', '=', int(app.get('appId'))), |
||||
|
('user_id', '=', request.env.user.id) |
||||
|
]) |
||||
|
exist.unlink() if exist else None |
||||
|
total_recent = recent_app.search([('user_id', '=', request.env.user.id)]) |
||||
|
if len(total_recent) > 4: |
||||
|
total_recent[0].unlink() |
||||
|
recent_app.create({ |
||||
|
'app_id': int(app.get('appId')), |
||||
|
'user_id': request.env.user.id |
||||
|
}) |
||||
|
|
||||
|
@http.route(['/theme_studio/get_recent_apps'], type="json") |
||||
|
def get_recent_apps(self): |
||||
|
recent_app = request.env['recent.apps'].sudo() |
||||
|
return recent_app.search_read([ |
||||
|
('user_id', '=', request.env.user.id) |
||||
|
]) |
||||
|
|
||||
|
@http.route(['/theme_studio/add_menu_bookmarks'], type="json") |
||||
|
def add_menu_bookmarks(self, menu): |
||||
|
menu_bookmark = request.env['infinito.menu.bookmark'].sudo() |
||||
|
menu_bookmark.create({ |
||||
|
'action_id': int(menu.get('actionId')), |
||||
|
'user_id': request.env.user.id, |
||||
|
'url': menu.get('menuUrl'), |
||||
|
}) |
||||
|
|
||||
|
@http.route(['/theme_studio/remove_menu_bookmarks'], type="json") |
||||
|
def remove_menu_bookmarks(self, menu): |
||||
|
menu_bookmark = request.env['infinito.menu.bookmark'].sudo().search([ |
||||
|
('action_id', '=', int(menu.get('actionId'))), |
||||
|
('user_id', '=', request.env.user.id) |
||||
|
]) |
||||
|
if menu_bookmark: |
||||
|
menu_bookmark.unlink() |
||||
|
|
||||
|
@http.route(['/theme_studio/get_presets'], type="json") |
||||
|
def get_presets(self): |
||||
|
working_dir = os.path.dirname(os.path.realpath(__file__)) |
||||
|
working_dir = working_dir.replace('/controllers', '') |
||||
|
file_path = working_dir + '/static/src/json/presets.json' |
||||
|
file = open(file_path, 'r') |
||||
|
presets = json.load(file) |
||||
|
|
||||
|
return presets |
@ -0,0 +1,7 @@ |
|||||
|
## Module <backend_theme_infinito> |
||||
|
|
||||
|
#### 23.11.2022 |
||||
|
#### Version 16.0.1.0.0 |
||||
|
#### ADD |
||||
|
Initial Commit |
||||
|
|
@ -0,0 +1,158 @@ |
|||||
|
"""Hooks for Changing Menu Web_icon""" |
||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
import base64 |
||||
|
|
||||
|
from odoo import api, SUPERUSER_ID |
||||
|
from odoo.modules import get_module_resource |
||||
|
|
||||
|
|
||||
|
def icons_post_init_hook(cr, registry): |
||||
|
"""post init hook for changing module icons""" |
||||
|
env = api.Environment(cr, SUPERUSER_ID, {}) |
||||
|
menu_item = env['ir.ui.menu'].search([('parent_id', '=', False)]) |
||||
|
|
||||
|
for menu in menu_item: |
||||
|
if menu.name == 'Contacts': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'contact.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Link Tracker': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'link-tracker.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Dashboards': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'dashboard.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Sales': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'sales.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Invoicing': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'invoice.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Inventory': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'inventory.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Purchase': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'purchase.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Calendar': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'calendar.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'CRM': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'crm.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Notes': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'notes.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Website': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'website.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Point of Sale': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'pos.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Manufacturing': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'manufacturing.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Repairs': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'repairs.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Email Marketing': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'marketing.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'SMS Marketing': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'sms-marketing.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Project': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'project.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Surveys': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'surveys.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Employees': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'employees.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Recruitment': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'recruitment.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Attendances': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'attendance.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Time Off': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'time-off.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Expenses': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'expense.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Maintenance': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'maintenance.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Live Chat': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'live-chat.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Lunch': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'lunch.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Fleet': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'fleet.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Timesheets': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'timesheets.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Events': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'events.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'eLearning': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'elearning.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
||||
|
if menu.name == 'Members': |
||||
|
img_path = get_module_resource( |
||||
|
'backend_theme_infinito', 'static', 'src', 'img', 'icons', 'members.png') |
||||
|
menu.write({'web_icon_data': base64.b64encode(open(img_path, "rb").read())}) |
@ -0,0 +1,26 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import res_config_settings |
||||
|
from . import res_users |
||||
|
from . import ir_http |
||||
|
from . import recent_apps |
||||
|
from . import menu_bookmark |
@ -0,0 +1,99 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import models |
||||
|
|
||||
|
|
||||
|
def float_to_time(time): |
||||
|
return '{0:02.0f}:{1:02.0f}'.format(*divmod(float(time) * 60, 60)) |
||||
|
|
||||
|
|
||||
|
class IrHttp(models.AbstractModel): |
||||
|
_inherit = 'ir.http' |
||||
|
|
||||
|
def session_info(self): |
||||
|
res = super(IrHttp, self).session_info() |
||||
|
get_param = self.env['ir.config_parameter'].sudo().get_param |
||||
|
if self.env.user.has_group('base.group_user'): |
||||
|
user_edit = get_param( |
||||
|
'backend_theme_infinito.is_user_edit', default=False) |
||||
|
res['userEdit'] = user_edit |
||||
|
if user_edit: |
||||
|
res['sidebar'] = self.env.user.is_sidebar_enabled |
||||
|
res['fullscreen'] = self.env.user.is_fullscreen_enabled |
||||
|
res['sidebarIcon'] = self.env.user.is_sidebar_icon |
||||
|
res['sidebarName'] = self.env.user.is_sidebar_name |
||||
|
res['sidebarCompany'] = self.env.user.is_sidebar_company |
||||
|
res['sidebarUser'] = self.env.user.is_sidebar_user |
||||
|
res['recentApps'] = self.env.user.is_recent_apps |
||||
|
res['fullScreenApp'] = self.env.user.is_fullscreen_app |
||||
|
res['infinitoRtl'] = self.env.user.is_rtl |
||||
|
res['infinitoDark'] = self.env.user.is_dark |
||||
|
res['infinitoDarkMode'] = self.env.user.dark_mode |
||||
|
res['infinitoDarkStart'] = float_to_time(self.env.user.dark_start) |
||||
|
res['infinitoDarkEnd'] = float_to_time(self.env.user.dark_end) |
||||
|
res['infinitoBookmark'] = self.env.user.is_menu_bookmark |
||||
|
res['loaderClass'] = self.env.user.loader_class |
||||
|
res['infinitoChameleon'] = self.env.user.is_chameleon |
||||
|
else: |
||||
|
res['sidebar'] = get_param( |
||||
|
'backend_theme_infinito.is_sidebar_enabled', default=False) |
||||
|
res['fullscreen'] = get_param( |
||||
|
'backend_theme_infinito.is_fullscreen_enabled', default=False) |
||||
|
res['sidebarIcon'] = get_param( |
||||
|
'backend_theme_infinito.is_sidebar_icon', default=False) |
||||
|
res['sidebarName'] = get_param( |
||||
|
'backend_theme_infinito.is_sidebar_name', default=False) |
||||
|
res['sidebarCompany'] = get_param( |
||||
|
'backend_theme_infinito.is_sidebar_company', default=False) |
||||
|
res['sidebarUser'] = get_param( |
||||
|
'backend_theme_infinito.is_sidebar_user', default=False) |
||||
|
res['recentApps'] = get_param( |
||||
|
'backend_theme_infinito.is_recent_apps', default=False) |
||||
|
res['fullScreenApp'] = get_param( |
||||
|
'backend_theme_infinito.is_fullscreen_app', default=False) |
||||
|
res['infinitoRtl'] = get_param( |
||||
|
'backend_theme_infinito.is_rtl', default=False) |
||||
|
res['infinitoDark'] = get_param( |
||||
|
'backend_theme_infinito.is_dark', default=False) |
||||
|
res['infinitoDarkMode'] = get_param( |
||||
|
'backend_theme_infinito.dark_mode', default=False) |
||||
|
res['infinitoDarkStart'] = float_to_time(get_param( |
||||
|
'backend_theme_infinito.dark_start', default=19.0)) |
||||
|
res['infinitoDarkEnd'] = float_to_time(get_param( |
||||
|
'backend_theme_infinito.dark_end', default=5.0)) |
||||
|
res['infinitoBookmark'] = get_param( |
||||
|
'backend_theme_infinito.is_menu_bookmark', default=False) |
||||
|
res['loaderClass'] = get_param( |
||||
|
'backend_theme_infinito.loader_class', default=False) |
||||
|
res['infinitoChameleon'] = get_param( |
||||
|
'backend_theme_infinito.is_chameleon', default=False) |
||||
|
menu_bookmark = self.env['infinito.menu.bookmark'].sudo(). \ |
||||
|
search([('user_id', '=', self.env.user.id)]) |
||||
|
list_bookmark = [] |
||||
|
for bookmark in menu_bookmark: |
||||
|
bkm = bookmark.read(['action_id', 'url', 'name'])[0] |
||||
|
bkm['short_name'] = bkm['name'][:2].upper() |
||||
|
list_bookmark.append(bkm) |
||||
|
res['infinitoBookmarks'] = menu_bookmark.action_id.ids |
||||
|
res['infinitoMenuBookmarks'] = list_bookmark |
||||
|
|
||||
|
return res |
@ -0,0 +1,32 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class ModelName(models.Model): |
||||
|
_name = 'infinito.menu.bookmark' |
||||
|
_description = 'Menu Bookmark' |
||||
|
|
||||
|
name = fields.Char(related='action_id.name') |
||||
|
action_id = fields.Many2one('ir.actions.act_window') |
||||
|
url = fields.Text('Url') |
||||
|
user_id = fields.Many2one('res.users') |
@ -0,0 +1,40 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models, api |
||||
|
|
||||
|
|
||||
|
class RecentApps(models.Model): |
||||
|
_name = 'recent.apps' |
||||
|
_description = 'Recent Apps' |
||||
|
|
||||
|
name = fields.Char(compute='_compute_icon', store=True) |
||||
|
app_id = fields.Integer() |
||||
|
icon = fields.Binary(compute='_compute_icon', store=True) |
||||
|
user_id = fields.Many2one('res.users') |
||||
|
|
||||
|
@api.depends('app_id') |
||||
|
def _compute_icon(self): |
||||
|
menu_ui = self.env['ir.ui.menu'] |
||||
|
for rec in self: |
||||
|
app = menu_ui.browse(rec.app_id) |
||||
|
rec.icon = app._compute_web_icon_data(app.web_icon) |
||||
|
rec.name = app.name |
@ -0,0 +1,109 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class ResConfigSettings(models.TransientModel): |
||||
|
_inherit = 'res.config.settings' |
||||
|
|
||||
|
is_user_edit = fields.Boolean('User edit', default=False) |
||||
|
is_sidebar_enabled = fields.Boolean('Sidebar Enabled', default=False) |
||||
|
is_fullscreen_enabled = fields.Boolean('Full screen Enabled', default=False) |
||||
|
is_sidebar_icon = fields.Boolean('Sidebar icon Enabled', default=True) |
||||
|
is_sidebar_name = fields.Boolean('Sidebar name Enabled', default=True) |
||||
|
is_sidebar_company = fields.Boolean('Sidebar Company Enabled', default=False) |
||||
|
is_sidebar_user = fields.Boolean('Sidebar User Enabled', default=False) |
||||
|
is_recent_apps = fields.Boolean('Recent Apps Enabled', default=False) |
||||
|
is_fullscreen_app = fields.Boolean('Full screen Apps Enabled', default=False) |
||||
|
is_rtl = fields.Boolean('Rtl Enabled', default=False) |
||||
|
is_dark = fields.Boolean('Dark mode Enabled', default=False) |
||||
|
is_menu_bookmark = fields.Boolean('Menu Bookmark mode Enabled', default=False) |
||||
|
is_chameleon = fields.Boolean('Chameleon mode Enabled', default=False) |
||||
|
dark_mode = fields.Selection([ |
||||
|
('all', 'All'), |
||||
|
('schedule', 'Schedule'), |
||||
|
('auto', 'Automatic'), |
||||
|
], default='all') |
||||
|
dark_start = fields.Float('Dark Start', default=19.0) |
||||
|
dark_end = fields.Float('Dark End', default=5.0) |
||||
|
loader_class = fields.Char('Loader', default='default') |
||||
|
|
||||
|
@api.model |
||||
|
def get_values(self): |
||||
|
res = super(ResConfigSettings, self).get_values() |
||||
|
get_param = self.env['ir.config_parameter'].sudo().get_param |
||||
|
res['is_user_edit'] = get_param('backend_theme_infinito.is_user_edit', default=False) |
||||
|
res['is_sidebar_enabled'] = get_param('backend_theme_infinito.is_sidebar_enabled', default=False) |
||||
|
res['is_fullscreen_enabled'] = get_param('backend_theme_infinito.is_fullscreen_enabled', default=False) |
||||
|
res['is_sidebar_icon'] = get_param('backend_theme_infinito.is_sidebar_icon', default=False) |
||||
|
res['is_sidebar_name'] = get_param('backend_theme_infinito.is_sidebar_name', default=False) |
||||
|
res['is_sidebar_company'] = get_param('backend_theme_infinito.is_sidebar_company', default=False) |
||||
|
res['is_sidebar_user'] = get_param('backend_theme_infinito.is_sidebar_user', default=False) |
||||
|
res['is_recent_apps'] = get_param('backend_theme_infinito.is_recent_apps', default=False) |
||||
|
res['is_rtl'] = get_param('backend_theme_infinito.is_rtl', default=False) |
||||
|
res['is_dark'] = get_param('backend_theme_infinito.is_dark', default=False) |
||||
|
res['is_menu_bookmark'] = get_param('backend_theme_infinito.is_menu_bookmark', default=False) |
||||
|
res['dark_mode'] = get_param('backend_theme_infinito.dark_mode', default='all') |
||||
|
res['dark_start'] = get_param('backend_theme_infinito.dark_start', default=19.0) |
||||
|
res['dark_end'] = get_param('backend_theme_infinito.dark_end', default=5.0) |
||||
|
res['loader_class'] = get_param('backend_theme_infinito.loader_class', default=5.0) |
||||
|
res['is_chameleon'] = get_param('backend_theme_infinito.is_chameleon', default=False) |
||||
|
|
||||
|
return res |
||||
|
|
||||
|
@api.model |
||||
|
def set_values(self): |
||||
|
set_param = self.env['ir.config_parameter'].sudo().set_param |
||||
|
set_param('backend_theme_infinito.is_user_edit', |
||||
|
self.is_user_edit) |
||||
|
set_param('backend_theme_infinito.is_sidebar_enabled', |
||||
|
self.is_sidebar_enabled) |
||||
|
set_param('backend_theme_infinito.is_fullscreen_enabled', |
||||
|
self.is_fullscreen_enabled) |
||||
|
set_param('backend_theme_infinito.is_sidebar_icon', |
||||
|
self.is_sidebar_icon) |
||||
|
set_param('backend_theme_infinito.is_sidebar_name', |
||||
|
self.is_sidebar_name) |
||||
|
set_param('backend_theme_infinito.is_sidebar_company', |
||||
|
self.is_sidebar_company) |
||||
|
set_param('backend_theme_infinito.is_sidebar_user', |
||||
|
self.is_sidebar_user) |
||||
|
set_param('backend_theme_infinito.is_recent_apps', |
||||
|
self.is_recent_apps) |
||||
|
set_param('backend_theme_infinito.is_rtl', |
||||
|
self.is_rtl) |
||||
|
set_param('backend_theme_infinito.is_dark', |
||||
|
self.is_dark) |
||||
|
set_param('backend_theme_infinito.dark_mode', |
||||
|
self.dark_mode) |
||||
|
set_param('backend_theme_infinito.dark_start', |
||||
|
self.dark_start) |
||||
|
set_param('backend_theme_infinito.dark_end', |
||||
|
self.dark_end) |
||||
|
set_param('backend_theme_infinito.is_menu_bookmark', |
||||
|
self.is_menu_bookmark) |
||||
|
set_param('backend_theme_infinito.loader_class', |
||||
|
self.loader_class) |
||||
|
set_param('backend_theme_infinito.is_chameleon', |
||||
|
self.is_chameleon) |
||||
|
|
||||
|
super(ResConfigSettings, self).set_values() |
@ -0,0 +1,50 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2022-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class User(models.Model): |
||||
|
_inherit = 'res.users' |
||||
|
|
||||
|
is_sidebar_enabled = fields.Boolean('Sidebar Enabled', default=False) |
||||
|
is_fullscreen_enabled = fields.Boolean('Full screen Enabled', default=False) |
||||
|
is_sidebar_icon = fields.Boolean('Sidebar icon Enabled', default=True) |
||||
|
is_sidebar_name = fields.Boolean('Sidebar name Enabled', default=True) |
||||
|
is_sidebar_company = fields.Boolean('Sidebar Company Enabled', |
||||
|
default=False) |
||||
|
is_sidebar_user = fields.Boolean('Sidebar User Enabled', default=False) |
||||
|
is_recent_apps = fields.Boolean('Recent Apps Enabled', default=False) |
||||
|
is_fullscreen_app = fields.Boolean('Full screen Apps Enabled', |
||||
|
default=False) |
||||
|
is_rtl = fields.Boolean('Rtl Enabled', default=False) |
||||
|
is_dark = fields.Boolean('Dark mode Enabled', default=False) |
||||
|
is_menu_bookmark = fields.Boolean('Menu Bookmark mode Enabled', |
||||
|
default=False) |
||||
|
is_chameleon = fields.Boolean('Chameleon mode Enabled', default=False) |
||||
|
dark_mode = fields.Selection([ |
||||
|
('all', 'All'), |
||||
|
('schedule', 'Schedule'), |
||||
|
('auto', 'Automatic'), |
||||
|
], default='all') |
||||
|
dark_start = fields.Float('Dark Start', default=19.0) |
||||
|
dark_end = fields.Float('Dark End', default=5.0) |
||||
|
loader_class = fields.Char('Loader', default='default') |
After Width: | Height: | Size: 349 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 258 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 197 KiB |
After Width: | Height: | Size: 16 MiB |
After Width: | Height: | Size: 11 MiB |
After Width: | Height: | Size: 6.6 MiB |
After Width: | Height: | Size: 3.4 MiB |
After Width: | Height: | Size: 2.1 MiB |
After Width: | Height: | Size: 8.8 MiB |
After Width: | Height: | Size: 10 MiB |
After Width: | Height: | Size: 27 MiB |
After Width: | Height: | Size: 4.9 MiB |
After Width: | Height: | Size: 2.8 MiB |
After Width: | Height: | Size: 6.6 MiB |
After Width: | Height: | Size: 174 KiB |
After Width: | Height: | Size: 153 KiB |
After Width: | Height: | Size: 174 KiB |
After Width: | Height: | Size: 239 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 266 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 197 KiB |
After Width: | Height: | Size: 221 KiB |
After Width: | Height: | Size: 187 KiB |
After Width: | Height: | Size: 1.7 MiB |
After Width: | Height: | Size: 1012 KiB |
After Width: | Height: | Size: 202 KiB |
After Width: | Height: | Size: 149 KiB |
After Width: | Height: | Size: 197 KiB |
After Width: | Height: | Size: 166 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 98 KiB |
@ -0,0 +1,34 @@ |
|||||
|
.o_web_client { |
||||
|
background-color: var(--bg_white); |
||||
|
} |
||||
|
|
||||
|
.o_web_client > header { |
||||
|
margin: 10px 10px 0px 10px; |
||||
|
border-radius: 10px; |
||||
|
box-shadow: 1px 1px 15px 0; |
||||
|
} |
||||
|
|
||||
|
.o_main_navbar { |
||||
|
border-radius: 10px; |
||||
|
} |
||||
|
|
||||
|
.o_web_client > .o_action_manager, #sidebar_panel, .oe_kanban_card { |
||||
|
margin: 15px; |
||||
|
border-radius: 10px; |
||||
|
box-shadow: 1px 1px 15px 0; |
||||
|
padding: 15px; |
||||
|
background-color: var(--bg_white); |
||||
|
} |
||||
|
|
||||
|
#sidebar_panel { |
||||
|
margin-left: 0px; |
||||
|
background-color: var(--nav_bar_color); |
||||
|
} |
||||
|
|
||||
|
.o_main_navbar .o_navbar_apps_menu.show .o-dropdown--menu dropdown-menu { |
||||
|
border-radius: 10px 0 10px 10px; |
||||
|
} |
||||
|
|
||||
|
.oe_kanban_card { |
||||
|
box-shadow: none; |
||||
|
} |
@ -0,0 +1,128 @@ |
|||||
|
/* Rotation */ |
||||
|
|
||||
|
.rotating::before{ |
||||
|
content: " "; |
||||
|
position: absolute; |
||||
|
top: calc(50% - 25px); |
||||
|
left: calc(50% - 25px); |
||||
|
height: 50px; |
||||
|
width: 50px; |
||||
|
background-image: linear-gradient(to bottom,black 50%, white 50%); |
||||
|
border-radius: 50%; |
||||
|
animation: rotate 1s; |
||||
|
animation-iteration-count: infinite; |
||||
|
} |
||||
|
|
||||
|
.rotating::after{ |
||||
|
content: " "; |
||||
|
position: absolute; |
||||
|
top: calc(50% - 20px); |
||||
|
left: calc(50% - 20px); |
||||
|
height: 40px; |
||||
|
width: 40px; |
||||
|
background-color: #020202; |
||||
|
border-radius: 50%; |
||||
|
} |
||||
|
|
||||
|
/* Blinking */ |
||||
|
|
||||
|
.blinking::after{ |
||||
|
content: " "; |
||||
|
position: absolute; |
||||
|
top: calc(50% - 25px); |
||||
|
left: calc(50% - 25px); |
||||
|
height: 50px; |
||||
|
width: 50px; |
||||
|
border-radius: 50%; |
||||
|
background-color:#fff; |
||||
|
animation: blink 2000ms ease infinite; |
||||
|
} |
||||
|
|
||||
|
.blinking-2::after{ |
||||
|
background-color: transparent; |
||||
|
border: 2px solid white; |
||||
|
transform: scale(0); |
||||
|
animation: blink-2 2000ms ease-out infinite,blink-2a 2s ease-out infinite; |
||||
|
animation-fill-mode: forwards; |
||||
|
} |
||||
|
|
||||
|
.bounce::after{ |
||||
|
content: " "; |
||||
|
position: absolute; |
||||
|
top: calc(50% - 50px); |
||||
|
left: calc(50% - 25px); |
||||
|
height: 50px; |
||||
|
width: 50px; |
||||
|
box-sizing: border-box; |
||||
|
background-image: linear-gradient(to bottom,rgb(255, 255, 255) 60%, rgb(235, 235, 235) 80%, rgb(210, 210, 210)); |
||||
|
border-radius: 50%; |
||||
|
animation: bounce 2s; |
||||
|
animation-iteration-count: infinite; |
||||
|
} |
||||
|
|
||||
|
.ring:after { |
||||
|
content: " "; |
||||
|
display: block; |
||||
|
width: 64px; |
||||
|
height: 64px; |
||||
|
margin: 8px; |
||||
|
border-radius: 50%; |
||||
|
border: 6px solid #fff; |
||||
|
border-color: #fff transparent #fff transparent; |
||||
|
animation: ring 1.2s linear infinite; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* Key frames */ |
||||
|
|
||||
|
@keyframes rotate{ |
||||
|
from{ |
||||
|
transform: rotate(0deg); |
||||
|
} |
||||
|
to{ |
||||
|
transform: rotate(360deg); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@keyframes blink{ |
||||
|
0%{ |
||||
|
transform: scale(1); |
||||
|
} |
||||
|
50%{ |
||||
|
transform: scale(1.5); |
||||
|
} |
||||
|
100%{ |
||||
|
transform: scale(1); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@keyframes blink-2{ |
||||
|
0%{ |
||||
|
transform: scale(0.2); |
||||
|
} |
||||
|
100%{ |
||||
|
transform: scale(1.5); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@keyframes bounce{ |
||||
|
0%,100%{ |
||||
|
transform: translateY(0); |
||||
|
height: 50px; |
||||
|
width: 50px; |
||||
|
} |
||||
|
50%{ |
||||
|
transform: translateY(50px); |
||||
|
height: 45px; |
||||
|
width: 55px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@keyframes ring { |
||||
|
0% { |
||||
|
transform: rotate(0deg); |
||||
|
} |
||||
|
100% { |
||||
|
transform: rotate(360deg); |
||||
|
} |
||||
|
} |
After Width: | Height: | Size: 274 B |
After Width: | Height: | Size: 260 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 324 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 527 B |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 506 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 25 KiB |