Skip to content

Commit 364aca4

Browse files
committed
fix(spp_branding_kit): resolve XPath conflicts with g2p_theme module
- Replace problematic XPath selectors with CSS-based approach - Add login_branding.css to handle Odoo branding removal - Simplify login_templates.xml to avoid template inheritance conflicts - Move branding logic from XML to frontend assets for better compatibility Fixes build failures caused by missing elements in different environments.
1 parent 27e9550 commit 364aca4

File tree

3 files changed

+45
-11
lines changed

3 files changed

+45
-11
lines changed

spp_branding_kit/__manifest__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
"spp_branding_kit/static/src/js/telemetry_manager.js",
5555
"spp_branding_kit/static/src/js/apps_filter.js",
5656
],
57+
"web.assets_frontend": [
58+
"spp_branding_kit/static/src/css/login_branding.css",
59+
],
5760
},
5861
"images": [
5962
"static/description/icon.png",
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* ABOUTME: CSS for OpenSPP branding on login pages */
2+
/* ABOUTME: Hides Odoo branding and adds OpenSPP branding */
3+
4+
/* Hide any existing Odoo branding */
5+
a[href*="odoo.com"] {
6+
display: none !important;
7+
}
8+
9+
.o_footer_copyright a[href*="odoo.com"] {
10+
display: none !important;
11+
}
12+
13+
footer a[href*="odoo.com"] {
14+
display: none !important;
15+
}
16+
17+
/* Hide "Manage Databases" link */
18+
a[href="/web/database/manager"] {
19+
display: none !important;
20+
}
21+
22+
/* Add OpenSPP branding */
23+
body::after {
24+
content: "Powered by OpenSPP";
25+
position: fixed;
26+
bottom: 10px;
27+
left: 50%;
28+
transform: translateX(-50%);
29+
color: #777;
30+
font-size: 12px;
31+
z-index: 1000;
32+
pointer-events: none;
33+
}
34+
35+
/* Ensure footer is visible when present */
36+
.oe_login_form ~ footer,
37+
.o_database_list ~ footer {
38+
display: block !important;
39+
}

spp_branding_kit/views/login_templates.xml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@
22
<!-- ABOUTME: Login page templates for OpenSPP branding -->
33
<!-- ABOUTME: Customizes the login interface with OpenSPP branding -->
44
<odoo>
5-
<!-- Custom Login Page Layout -->
5+
<!-- Custom Login Page Layout - Minimal override -->
66
<template
77
id="custom_login_layout_openspp"
88
inherit_id="web.login_layout"
99
name="OpenSPP Custom Login Layout"
10-
priority="99"
10+
priority="100"
1111
>
12-
<!-- Replace "Powered by Odoo" in login footer -->
13-
<xpath expr="//a[contains(@href, 'www.odoo.com')]" position="replace">
14-
<span>Powered by OpenSPP</span>
15-
</xpath>
16-
17-
<!-- Remove "Manage Databases" link if configured -->
18-
<xpath expr="//a[@href='/web/database/manager']" position="attributes">
19-
<attribute name="class" add="d-none" separator=" " />
20-
</xpath>
12+
<!-- Only override g2p_theme's no_footer setting - branding handled via CSS assets -->
2113
</template>
2214

2315

0 commit comments

Comments
 (0)