diff --git a/backend_theme_infinito/__manifest__.py b/backend_theme_infinito/__manifest__.py index fa5f7177e..7549fb223 100755 --- a/backend_theme_infinito/__manifest__.py +++ b/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.3", + "version": "17.0.1.0.1", 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', diff --git a/backend_theme_infinito/controllers/base_pwa.py b/backend_theme_infinito/controllers/base_pwa.py index 5bbad0d84..da05c483e 100755 --- a/backend_theme_infinito/controllers/base_pwa.py +++ b/backend_theme_infinito/controllers/base_pwa.py @@ -23,7 +23,6 @@ import json from odoo import http from odoo.http import request -from odoo.modules.module import get_module_resource class BasePwa(http.Controller): """ @@ -37,14 +36,13 @@ 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': f'{src}', + 'src': '/backend_theme_infinito/static/src/img/menu.png', 'type': 'image/png', 'sizes': '144x144', 'purpose': 'any maskable' diff --git a/backend_theme_infinito/controllers/main.py b/backend_theme_infinito/controllers/main.py index db615447a..714b32b04 100755 --- a/backend_theme_infinito/controllers/main.py +++ b/backend_theme_infinito/controllers/main.py @@ -26,8 +26,6 @@ import re from odoo import http from odoo.http import request -from odoo.modules.module import get_module_resource - def minify_css(path): """ @@ -139,8 +137,11 @@ class ThemeStudio(http.Controller): changed_styles_str = kwargs.get('changed_styles', '{}') object_class = kwargs.get('object_class', '') changed_styles = json.loads(changed_styles_str) - file_path = get_module_resource('backend_theme_infinito', 'static', 'src', 'css', 'dynamic_styles.css') + 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') @@ -190,7 +191,9 @@ class ThemeStudio(http.Controller): ``` """ selector = kwargs.get('selector', '') - file_path = get_module_resource('backend_theme_infinito', 'static', 'src', 'css', 'dynamic_styles.css') + 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) @@ -236,7 +239,9 @@ class ThemeStudio(http.Controller): reset_to_default() ``` """ - file_path = get_module_resource('backend_theme_infinito', 'static', 'src', 'css', 'dynamic_styles.css') + 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 @@ -433,35 +438,51 @@ class ThemeStudio(http.Controller): 'user_id': request.env.user.id }) - @http.route(['/theme_studio/get_recent_apps'], type="json") + @http.route(['/theme_studio/get_recent_apps'], type="json", auth="user") def get_recent_apps(self): """ - Retrieve the list of recent applications for the current user. + Retrieve the list of recent applications for the current user. - Returns: - list: A list of dictionaries containing the recent applications' - information, - or an empty list if no recent apps are found. + Returns: + list: A list of dictionaries containing the recent applications' + information, + or an empty list if no recent apps are found. - This function retrieves the list of recent applications for the current - user from the database. It returns a list of dictionaries containing the - information of each recent application, such as its ID, name, and other - relevant details. + This function retrieves the list of recent applications for the current + user from the database. It returns a list of dictionaries containing the + information of each recent application, such as its ID, name, and other + relevant details. - Example: - To retrieve the list of recent applications for the current user: + Example: + To retrieve the list of recent applications for the current user: - ```python - from my_theme_module import get_recent_apps + ```python + from my_theme_module import get_recent_apps - recent_apps = get_recent_apps() - print(recent_apps) - ``` - """ - recent_app = request.env['recent.apps'].sudo() - return recent_app.search_read([ - ('user_id', '=', request.env.user.id) - ]) + recent_apps = get_recent_apps() + print(recent_apps) + ``` + """ + recent_apps_model = request.env['recent.apps'].sudo() + menu_model = request.env['ir.ui.menu'].sudo() + + results = [] + recent_records = recent_apps_model.search( + [('user_id', '=', request.env.user.id)], + order="id desc") + for rec in recent_records: + menu = menu_model.browse(rec.app_id) + if not menu.exists(): + continue + icon_data = menu.web_icon_data # base64 + icon_type = "svg" if (menu.web_icon and menu.web_icon.endswith("svg")) else "png" + results.append({ + "app_id": menu.id, + "name": menu.name, + "icon": icon_data, + "type": icon_type, + }) + return results @http.route(['/theme_studio/add_menu_bookmarks'], type="json") def add_menu_bookmarks(self, args): @@ -571,7 +592,10 @@ class ThemeStudio(http.Controller): print(presets) ``` """ - file_path = get_module_resource("backend_theme_infinito", "static", "src", "json", "presets.json") + 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 diff --git a/backend_theme_infinito/doc/RELEASE_NOTES.md b/backend_theme_infinito/doc/RELEASE_NOTES.md index c67e0dc26..83cb9f991 100755 --- a/backend_theme_infinito/doc/RELEASE_NOTES.md +++ b/backend_theme_infinito/doc/RELEASE_NOTES.md @@ -5,18 +5,7 @@ #### ADD Initial Commit for Infinito Backend Theme -#### 04.12.2024 +#### 25.11.2025 #### Version 17.0.1.0.1 -##### BUGFIX -- Fixed the style issue in the sidebar menu buttons. - -#### 23.06.2025 -#### Version 17.0.1.0.2 -##### BUGFIX -- 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. -- \ No newline at end of file +#### UPDT +Resolved the issue of recent apps \ No newline at end of file diff --git a/backend_theme_infinito/icon_hooks.py b/backend_theme_infinito/icon_hooks.py index ea95344e2..b48da6aec 100755 --- a/backend_theme_infinito/icon_hooks.py +++ b/backend_theme_infinito/icon_hooks.py @@ -22,6 +22,7 @@ ############################################################################# import base64 +from odoo import api, SUPERUSER_ID from odoo.modules import get_module_resource diff --git a/backend_theme_infinito/static/src/css/dynamic_styles.css b/backend_theme_infinito/static/src/css/dynamic_styles.css index 958903ff5..e69de29bb 100644 --- a/backend_theme_infinito/static/src/css/dynamic_styles.css +++ b/backend_theme_infinito/static/src/css/dynamic_styles.css @@ -1,2 +0,0 @@ -/* This Styles are generated automatically by Theme Studio */ - . {background-color: rgb(250, 0, 0) !important;} \ No newline at end of file diff --git a/backend_theme_infinito/static/src/css/style.css b/backend_theme_infinito/static/src/css/style.css index 6b08e92d1..27cc43732 100755 --- a/backend_theme_infinito/static/src/css/style.css +++ b/backend_theme_infinito/static/src/css/style.css @@ -1528,7 +1528,7 @@ label:hover div.popover.fade.in { #theme_editor_sidebar { margin-left: 1587px !important; - height: inherit; + height: 934px; } .oe_kanban_action_button { @@ -1642,6 +1642,9 @@ label:hover div.popover.fade.in { .infinito-form-select > option { background-color: var(--sub-color-i-3); } +select > option { + background: inherit; +} .o_filter_menu > .fa-filter { color: var(--button-bg) !important; @@ -1676,7 +1679,7 @@ label:hover div.popover.fade.in { } .o_form_button_create { - background-color: #5279be; + background-color: var(--button-bg) !important; transition: background-color 0.3s ease } diff --git a/backend_theme_infinito/static/src/js/recentApps.js b/backend_theme_infinito/static/src/js/recentApps.js index e0e0dab88..1ee73ca09 100755 --- a/backend_theme_infinito/static/src/js/recentApps.js +++ b/backend_theme_infinito/static/src/js/recentApps.js @@ -33,7 +33,7 @@ export default class InfinitoRecentApps extends owl.Component { // XML template for InfinitoRecentApps component InfinitoRecentApps.template = xml`
`; \ No newline at end of file diff --git a/backend_theme_infinito/static/src/js/theme_editor_sidebar.js b/backend_theme_infinito/static/src/js/theme_editor_sidebar.js index 30bd36ab9..817caf995 100755 --- a/backend_theme_infinito/static/src/js/theme_editor_sidebar.js +++ b/backend_theme_infinito/static/src/js/theme_editor_sidebar.js @@ -13,6 +13,8 @@ import {useService, useBus} from "@web/core/utils/hooks"; import {InfinitoDialog} from "./style_add" import {jsonrpc} from "@web/core/network/rpc_service"; import {Dialog} from "@web/core/dialog/dialog"; +import { variables, colors, to_color } from './variables'; + const {useRef, onWillStart, xml, onMounted} = owl; @@ -45,7 +47,7 @@ export class ThemeEditorSidebar extends Component { id="presets" t-on-change="_onPresetChange">