13 changed files with 414 additions and 287 deletions
@ -0,0 +1,33 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2021-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/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
""" |
||||
|
This module helps user to change the backend theme of the odoo according to |
||||
|
there choices |
||||
|
""" |
||||
|
from odoo import models, fields |
||||
|
|
||||
|
|
||||
|
class ResCompany(models.Model): |
||||
|
"""Inherits the Res Company Model""" |
||||
|
_inherit = 'res.company' |
||||
|
|
||||
|
background_image = fields.Binary(string="Background Image", attachment=True) |
@ -1,98 +1,105 @@ |
|||||
<templates id="template" xml:space="preserve"> |
<templates id="template" xml:space="preserve"> |
||||
|
<!-- Inherit the dropdown to select the apps, to add the function OnClickMainMenu--> |
||||
<t t-inherit="web.NavBar.AppsMenu" t-inherit-mode="extension" owl="1"> |
<t t-inherit="web.NavBar.AppsMenu" t-inherit-mode="extension" owl="1"> |
||||
<xpath expr="//Dropdown" |
<xpath expr="//Dropdown" |
||||
position="replace"> |
position="replace"> |
||||
<li class="dropdown d-flex justify-content-center align-items-center"> |
<div class="d-flex justify-content-center align-items-center o_main-menu-button p-2" |
||||
<a class="full" data-bs-toggle="dropdown" data-display="static" |
t-on-click="OnClickMainMenu"> |
||||
href="#"> |
<i class="oi oi-apps" |
||||
<i class="fa fa-th-large" |
style="font-size: 18px !important; color: white; margin-top: 3px;"/> |
||||
style="font-size: 18px !important; color: white; margin-top: 3px;"/> |
</div> |
||||
</a> |
</xpath> |
||||
<div class="dropdown-menu fullscreen-menu" role="menu"> |
</t> |
||||
<div class="search-container form-row align-items-center m-auto mb-5 col-12"> |
<!-- Added the installed apps to show the Enterprise like app drawer --> |
||||
<div class="search-input col-md-10 ml-auto mr-auto mb-5" |
<t t-inherit-mode="extension" t-inherit="web.NavBar" owl="1"> |
||||
t-on-input="_searchMenusSchedule"> |
<xpath expr="//header" position="after"> |
||||
<div class="input-group"> |
<div class="app_components"> |
||||
<div class="input-group-prepend"> |
<div class="search-container form-row align-items-center m-auto col-12" |
||||
<div class="input-group-text"> |
style="padding-left: calc((100vw - 850px) / 2);padding-right: calc((100vw - 850px) / 2);padding-top:20px;padding-bottom:20px; display: table;"> |
||||
<i class="fa fa-search"/> |
<div class="search-input col-md-10" |
||||
</div> |
style="padding:0.8rem 1.2rem;width: max-content;margin-left: -30px;" |
||||
</div> |
t-on-input="_searchMenusSchedule"> |
||||
<input type="search" |
<div class="input-group"> |
||||
autocomplete="off" |
<div class="input-group-prepend"> |
||||
placeholder="Search menus..." |
<div class="input-group-text" |
||||
class="form-control"/> |
style="background:none;border:none;color:white;font-size:1.5rem;"> |
||||
|
<i class="fa fa-search"/> |
||||
</div> |
</div> |
||||
</div> |
</div> |
||||
<div class="search-results col-md-10 ml-auto mr-auto"/> |
<input type="search" |
||||
</div> |
autocomplete="off" |
||||
|
placeholder="Search menus..." |
||||
<div class="nav-container"> |
class="form-control" |
||||
<div class="app-menu"> |
style="background:none;border:none;color:white;"/> |
||||
<t t-foreach="menuService.getApps()" t-as="app" t-key="app_index"> |
|
||||
<a role="menuitem" |
|
||||
t-attf-href="#menu_id={{app.id}}" |
|
||||
class="dropdown-item o_app mt0" |
|
||||
t-att-data-menu-id="app.menuID" |
|
||||
t-att-data-menu-xmlid="app.xmlID" |
|
||||
t-att-data-action-id="app.actionID"> |
|
||||
<img t-if="app.webIcon.includes('.png')" t-att-title="app.name" |
|
||||
style="width: 70px !important;height: 70px !important;border-radius: 10px !important;margin: 5px 5px 5px 5px;" |
|
||||
t-attf-src="data:image/png;base64,{{app.webIconData}}"/> |
|
||||
<img t-if="app.webIcon.includes('.svg')" t-att-title="app.name" |
|
||||
style="width: 70px !important;height: 70px !important;border-radius: 10px !important;margin: 5px 5px 5px 5px;" |
|
||||
t-attf-src="data:image/svg+xml;base64,{{app.webIconData}}"/> |
|
||||
<b class="a_app_menu_title"><t t-esc="app.name"/></b> |
|
||||
</a> |
|
||||
|
|
||||
</t> |
|
||||
</div> |
</div> |
||||
</div> |
|
||||
</div> |
</div> |
||||
</li> |
<div class="search-results col-md-10 ml-auto mr-auto" |
||||
|
style="margin-top:20px;"/> |
||||
|
</div> |
||||
|
<div class="app-menu"> |
||||
|
<t t-foreach="menuService.getApps()" t-as="app" |
||||
|
t-key="app_index"> |
||||
|
<a role="menuitem" |
||||
|
t-on-click="() => this.onNavBarDropdownItemSelection(app)" |
||||
|
t-att-class="{ o_dropdown_active: menuService.getCurrentApp() === app }"> |
||||
|
<img t-if="app.webIcon.includes('.png')" |
||||
|
t-att-title="app.name" |
||||
|
style="width: 70px !important;height: 70px !important;margin: 5px 5px 5px 5px;" |
||||
|
t-attf-src="data:image/png;base64,{{app.webIconData}}"/> |
||||
|
<img t-if="app.webIcon.includes('.svg')" |
||||
|
t-att-title="app.name" |
||||
|
style="width: 70px !important;height: 70px !important;margin: 5px 5px 5px 5px;" |
||||
|
t-attf-src="data:image/svg+xml;base64,{{app.webIconData}}"/> |
||||
|
<b class="a_app_menu_title" |
||||
|
style="color:white;text-shadow: 1px 1px 1px rgb(0 0 0 / 40%);"><t t-esc="app.name"/></b> |
||||
|
</a> |
||||
|
</t> |
||||
|
</div> |
||||
|
</div> |
||||
</xpath> |
</xpath> |
||||
</t> |
</t> |
||||
|
<!-- To show the search results when the user search app from the app drawer --> |
||||
<t t-name="jazzy_backend_theme.SearchResults"> |
<t t-name="jazzy_backend_theme.SearchResults"> |
||||
<t t-foreach="results" t-as="result"> |
<t t-foreach="results" t-as="result"> |
||||
<div class="search_icons"> |
|
||||
<a t-attf-class="o-menu-search-result dropdown-item col-12 ml-auto mr-auto #{result_first ? 'active' : ''}" |
<a t-attf-class="o-menu-search-result dropdown-item col-12 ml-auto mr-auto #{result_first ? 'active' : ''}" |
||||
t-attf-style="background-image:url('data:image/svg+xml;base64,#{result.webIconData}')" |
t-attf-style="background-image:url('data:image/png;base64,#{result.webIconData}')" |
||||
t-attf-href="#menu_id=#{result.id}&action_id=#{result.actionID}" |
t-attf-href="#menu_id=#{result.id}&action_id=#{result.actionID}" |
||||
t-att-data-menu-id="result.id" |
t-att-data-menu-id="result.id" |
||||
t-att-data-action-id="result.actionID" |
t-att-data-action-id="result.actionID" |
||||
t-raw="result.name" |
t-raw="result.name" |
||||
onclick="$('.dropdown-menu').removeClass('show'); $('.search-results').addClass('o_hidden'); $('.app-menu').removeClass('o_hidden'); $('.search-input input').val('');"/> |
style="color:white;" |
||||
</div> |
onclick="$('.o_menu_sections').css('display','flex');$('.search-results').addClass('o_hidden');$('.o_menu_brand').css('display','flex');$('.app_components').css('display','none'); $('.app-menu').removeClass('o_hidden'); $('.search-input input').val('');$('.o_action_manager').attr('style','display: block !important');$('.sidebar_panel').attr('style','display: block !important');"/> |
||||
</t> |
</t> |
||||
</t> |
</t> |
||||
|
<!-- To show the sidebar to select the apps from the sidebar --> |
||||
<t t-inherit="web.NavBar" t-inherit-mode="extension" owl="1"> |
<t t-inherit="web.NavBar" t-inherit-mode="extension" owl="1"> |
||||
<xpath expr="//nav[hasclass('o_main_navbar')]" position="after"> |
<xpath expr="//nav[hasclass('o_main_navbar')]" position="after"> |
||||
|
<div class="sidebar_panel" id="sidebar_panel"> |
||||
<div class="sidebar_panel" id="sidebar_panel"> |
<div class="sidebar"> |
||||
<div class="sidebar"> |
<ul class="sidebar_menu"> |
||||
<ul class="sidebar_menu"> |
<t t-foreach="menuService.getApps()" t-as="app" |
||||
<t t-foreach="menuService.getApps()" t-as="app" t-key="app_index"> |
t-key="app_index"> |
||||
<li> |
<li> |
||||
<a role="menuitem" |
<a role="menuitem" |
||||
t-attf-href="#menu_id={{app.id}}" |
t-attf-href="#menu_id={{app.id}}" |
||||
class="dropdown-item o_app mt0" |
class="dropdown-item o_app mt0" |
||||
t-att-data-menu-id="app.menuID" |
t-att-data-menu-id="app.menuID" |
||||
t-att-data-menu-xmlid="app.xmlID" |
t-att-data-menu-xmlid="app.xmlID" |
||||
t-att-data-action-id="app.actionID"> |
t-att-data-action-id="app.actionID"> |
||||
<img t-if="app.webIcon.includes('.png')" t-att-title="app.name" |
<img t-if="app.webIcon.includes('.png')" |
||||
style="width: 25px !important;height: 25px !important;border-radius: 5px !important;padding:0 !important;" |
t-att-title="app.name" |
||||
t-attf-src="data:image/png;base64,{{app.webIconData}}"/> |
style="width: 25px !important;height: 25px !important;border-radius: 5px !important;padding:0 !important;" |
||||
<img t-if="app.webIcon.includes('.svg')" t-att-title="app.name" |
t-attf-src="data:image/png;base64,{{app.webIconData}}"/> |
||||
style="width: 25px !important;height: 25px !important;border-radius: 5px !important;padding:0 !important;" |
<img t-if="app.webIcon.includes('.svg')" |
||||
t-attf-src="data:image/svg+xml;base64,{{app.webIconData}}"/> |
t-att-title="app.name" |
||||
</a> |
style="width: 25px !important;height: 25px !important;border-radius: 5px !important;padding:0 !important;" |
||||
</li> |
t-attf-src="data:image/svg+xml;base64,{{app.webIconData}}"/> |
||||
</t> |
</a> |
||||
</ul> |
</li> |
||||
</div> |
</t> |
||||
</div> |
</ul> |
||||
</xpath> |
</div> |
||||
</t> |
</div> |
||||
|
</xpath> |
||||
</templates> |
</t> |
||||
|
</templates> |
||||
|
Loading…
Reference in new issue