first commit
This commit is contained in:
commit
efa3371c86
2
addons/home_dashboard/__init__.py
Normal file
2
addons/home_dashboard/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
# home_dashboard/__init__.py
|
||||
from . import controllers
|
||||
18
addons/home_dashboard/__manifest__.py
Normal file
18
addons/home_dashboard/__manifest__.py
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
'name': 'home_dashboard',
|
||||
'version': '1.0.1',
|
||||
'license': 'LGPL-3',
|
||||
'category': 'Website',
|
||||
'summary': 'Redirect login to home and show icon grid',
|
||||
'depends': ['base', 'web'],
|
||||
'data': [
|
||||
'views/home_template.xml',
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_frontend': [
|
||||
'home_dashboard/static/src/css/home_menu.css',
|
||||
],
|
||||
},
|
||||
'installable': True,
|
||||
'application': True,
|
||||
}
|
||||
BIN
addons/home_dashboard/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
addons/home_dashboard/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
2
addons/home_dashboard/controllers/__init__.py
Normal file
2
addons/home_dashboard/controllers/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
# home_dashboard/controllers/__init__.py
|
||||
from . import main
|
||||
Binary file not shown.
Binary file not shown.
24
addons/home_dashboard/controllers/main.py
Normal file
24
addons/home_dashboard/controllers/main.py
Normal file
@ -0,0 +1,24 @@
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
from odoo.addons.web.controllers.home import Home
|
||||
|
||||
class CustomHome(Home):
|
||||
@http.route('/web/login', type='http', auth="public", website=True)
|
||||
def web_login(self, *args, **kw):
|
||||
response = super(CustomHome, self).web_login(*args, **kw)
|
||||
if request.params.get('login_success') and request.session.uid:
|
||||
return request.redirect('/')
|
||||
return response
|
||||
|
||||
class ImageHome(http.Controller):
|
||||
@http.route('/', type='http', auth='user', website=True)
|
||||
def index(self, **kwargs):
|
||||
# Fetch root menus
|
||||
menus = request.env['ir.ui.menu'].sudo().search([
|
||||
('parent_id', '=', False)
|
||||
], order='sequence')
|
||||
|
||||
return request.render('home_dashboard.image_home_template', {
|
||||
'menus': menus,
|
||||
'user_id': request.env.user
|
||||
})
|
||||
129
addons/home_dashboard/static/src/css/home_menu.css
Normal file
129
addons/home_dashboard/static/src/css/home_menu.css
Normal file
@ -0,0 +1,129 @@
|
||||
/* Main background with premium gradient */
|
||||
.o_home_menu_background {
|
||||
background: linear-gradient(135deg, #f0f1f9 0%, #f6f7ff 50%, #ffffff 100%) !important;
|
||||
min-height: 100vh !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
font-family: 'Inter', 'Segoe UI', Roboto, sans-serif !important;
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
/* App grid layout */
|
||||
.o_apps {
|
||||
display: flex !important;
|
||||
flex-wrap: wrap !important;
|
||||
justify-content: center !important;
|
||||
gap: 30px 45px !important;
|
||||
max-width: 1000px !important;
|
||||
margin: 0 auto !important;
|
||||
padding: 20px !important;
|
||||
}
|
||||
|
||||
/* App card styling */
|
||||
.o_app {
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
align-items: center !important;
|
||||
text-decoration: none !important;
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
||||
width: 110px !important;
|
||||
}
|
||||
|
||||
.o_app_icon_container {
|
||||
background: white !important;
|
||||
width: 84px !important;
|
||||
height: 84px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
border-radius: 18px !important;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
|
||||
margin-bottom: 8px !important;
|
||||
transition: all 0.25s ease !important;
|
||||
}
|
||||
|
||||
.o_app:hover .o_app_icon_container {
|
||||
transform: translateY(-5px) !important;
|
||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08) !important;
|
||||
}
|
||||
|
||||
.o_app_icon {
|
||||
width: 52px !important;
|
||||
height: 52px !important;
|
||||
object-fit: contain !important;
|
||||
}
|
||||
|
||||
/* App name styling */
|
||||
.o_app_name {
|
||||
color: #4b4b4b !important;
|
||||
font-size: 13px !important;
|
||||
font-weight: 500 !important;
|
||||
text-align: center !important;
|
||||
letter-spacing: 0.1px !important;
|
||||
}
|
||||
|
||||
.o_app:hover .o_app_name {
|
||||
color: #000 !important;
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
/* Top bar styling */
|
||||
.o_home_top_bar {
|
||||
position: absolute !important;
|
||||
top: 15px !important;
|
||||
right: 30px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 15px !important;
|
||||
color: #444 !important;
|
||||
z-index: 100 !important;
|
||||
}
|
||||
|
||||
.o_top_icon {
|
||||
font-size: 18px !important;
|
||||
cursor: pointer !important;
|
||||
opacity: 0.6 !important;
|
||||
transition: all 0.2s !important;
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
.o_top_icon:hover {
|
||||
opacity: 1 !important;
|
||||
transform: scale(1.1) !important;
|
||||
}
|
||||
|
||||
/* AI Icon special styling */
|
||||
.o_ai_icon {
|
||||
background: linear-gradient(to bottom right, #ff5e62, #ff9966, #ffcc33) !important;
|
||||
-webkit-background-clip: text !important;
|
||||
background-clip: text !important;
|
||||
-webkit-text-fill-color: transparent !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
/* Badge for notifications */
|
||||
.badge_dot {
|
||||
position: absolute !important;
|
||||
top: -2px !important;
|
||||
right: -2px !important;
|
||||
width: 8px !important;
|
||||
height: 8px !important;
|
||||
background: #ff5e62 !important;
|
||||
border-radius: 50% !important;
|
||||
border: 1px solid white !important;
|
||||
}
|
||||
|
||||
.o_user_avatar {
|
||||
width: 30px !important;
|
||||
height: 30px !important;
|
||||
border-radius: 50% !important;
|
||||
background: #714b67 !important;
|
||||
/* Odoo purple */
|
||||
color: white !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
font-weight: 600 !important;
|
||||
font-size: 11px !important;
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
|
||||
}
|
||||
47
addons/home_dashboard/views/home_template.xml
Normal file
47
addons/home_dashboard/views/home_template.xml
Normal file
@ -0,0 +1,47 @@
|
||||
<odoo>
|
||||
<template id="image_home_template" name="Home Page Icons">
|
||||
<t t-call="web.frontend_layout">
|
||||
<t t-set="no_footer" t-value="True"/>
|
||||
<t t-set="no_header" t-value="True"/>
|
||||
|
||||
<div class="o_home_menu_background">
|
||||
<!-- Top Bar -->
|
||||
<div class="o_home_top_bar">
|
||||
<span class="o_top_icon o_ai_icon" title="AI">AI</span>
|
||||
<span class="o_top_icon fa fa-comments" title="Messages">
|
||||
<span class="badge_dot"/>
|
||||
</span>
|
||||
<span class="o_top_icon fa fa-clock-o" title="Activities"/>
|
||||
<span class="o_top_icon fa fa-cog" title="Settings"/>
|
||||
<div class="o_user_avatar">
|
||||
<t t-esc="user_id.name[0] if user_id else 'U'"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container" style="padding-top: 100px;">
|
||||
<div class="o_apps">
|
||||
<t t-foreach="menus" t-as="menu">
|
||||
<a t-attf-href="/web#menu_id={{menu.id}}" class="o_app">
|
||||
<div class="o_app_icon_container">
|
||||
<t t-if="menu.web_icon">
|
||||
<t t-set="icon_data" t-value="menu.web_icon.split(',')"/>
|
||||
<img t-attf-src="/{{icon_data[0]}}/{{icon_data[1]}}"
|
||||
class="o_app_icon" loading="lazy"
|
||||
onerror="this.style.display='none'; this.nextElementSibling.style.display='block';"/>
|
||||
<div class="o_app_icon fa fa-cube" style="font-size: 40px; color: #7c7bad; display: none;"/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div class="o_app_icon fa fa-cube" style="font-size: 40px; color: #7c7bad;"/>
|
||||
</t>
|
||||
</div>
|
||||
<div class="o_app_name">
|
||||
<t t-esc="menu.name"/>
|
||||
</div>
|
||||
</a>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
||||
34
docker-compose.yml
Normal file
34
docker-compose.yml
Normal file
@ -0,0 +1,34 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:15
|
||||
container_name: odoo_client1_db
|
||||
environment:
|
||||
POSTGRES_DB: postgres
|
||||
POSTGRES_USER: odoo
|
||||
POSTGRES_PASSWORD: odoo
|
||||
volumes:
|
||||
- client1_pgdata:/var/lib/postgresql/data
|
||||
restart: always
|
||||
|
||||
odoo:
|
||||
image: odoo:17.0
|
||||
container_name: odoo_client1
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- "10001:8069"
|
||||
environment:
|
||||
HOST: db
|
||||
USER: odoo
|
||||
PASSWORD: odoo
|
||||
volumes:
|
||||
- client1_odoo_data:/var/lib/odoo
|
||||
- ./addons:/mnt/extra-addons
|
||||
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
client1_pgdata:
|
||||
client1_odoo_data:
|
||||
Loading…
x
Reference in New Issue
Block a user