Skip to content

Commit b8e640f

Browse files
Merge pull request #144 from OpenSPP/edwin/spp-branding-kit-stable
chore(spp_branding_kit): upgrade to Production/Stable with 53 tests
2 parents b99d82c + e4369b3 commit b8e640f

19 files changed

Lines changed: 570 additions & 259 deletions

spp_branding_kit/README.rst

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ OpenSPP Branding Kit
1010
!! source digest: sha256:ecc47cd586fc9235dbd8b4ce4832732d894d51b47acf0cb12a9ca2dbda38f464
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
13-
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
1414
:target: https://odoo-community.org/page/development-status
15-
:alt: Beta
15+
:alt: Production/Stable
1616
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
1717
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1818
:alt: License: LGPL-3
@@ -43,8 +43,10 @@ Key Capabilities
4343
OpenSPP text
4444
- Post-install debranding: disables Odoo brand promotion messages,
4545
update notification crons, and theme store menu
46-
- Module filtering: adds "OpenSPP Apps" menu to filter and view
46+
- Module filtering: adds "OpenSPP Apps" filter and menu to view
4747
OpenSPP-specific applications
48+
- Debug restriction: optionally restricts debug mode access to
49+
administrators only
4850

4951
Key Models
5052
~~~~~~~~~~
@@ -72,9 +74,8 @@ Configuration
7274

7375
After installing:
7476

75-
1. Open the **Settings** app
76-
2. Scroll to the **OpenSPP Branding** section (app card with OpenSPP
77-
icon)
77+
1. Open **Settings**
78+
2. Scroll to the **OpenSPP Branding** app card
7879
3. Configure **System Name** (default: "OpenSPP Platform")
7980
4. Set **Documentation URL** and **Support URL** for help links
8081
5. Toggle **Display OpenSPP Branding** to show/hide "Powered by OpenSPP"
@@ -86,18 +87,21 @@ After installing:
8687
Post-install hook automatically disables Odoo brand promotion, module
8788
update notifications, and theme store menu.
8889

89-
Menu Location
90-
~~~~~~~~~~~~~
90+
UI Location
91+
~~~~~~~~~~~
9192

92-
- **Apps > OpenSPP Apps** - View and filter OpenSPP-specific
93+
- **Apps > OpenSPP Apps** — filtered view of OpenSPP-specific
9394
applications
95+
- **Settings > OpenSPP Branding** — branding and telemetry configuration
96+
- **Settings > General Settings > About** — OpenSPP platform information
97+
card
9498

9599
Security
96100
~~~~~~~~
97101

98-
This module does not define security groups or access rights.
99-
Configuration access follows standard Odoo settings permissions
100-
(requires ``base.group_system`` - Settings access).
102+
This module does not define new security groups or access control
103+
entries. It extends existing models that already have ACLs.
104+
Configuration access requires ``base.group_system`` (Settings).
101105

102106
Extension Points
103107
~~~~~~~~~~~~~~~~
@@ -125,6 +129,28 @@ Dependencies
125129
Changelog
126130
=========
127131

132+
19.0.2.0.1
133+
~~~~~~~~~~
134+
135+
- Upgrade to Production/Stable status
136+
- Fix category to ``OpenSPP/Configuration``
137+
- Use ``search_count()`` in ``get_paid_apps_count()`` for efficiency
138+
- Add proper JSON response content-type to ``/openspp/about`` endpoint
139+
- Clean up outdated ``requirements.txt`` referencing Odoo 17
140+
- Increase test coverage to 95%+ (utils, settings, controllers, HTTP
141+
endpoints)
142+
- Update ``readme/DESCRIPTION.md`` to follow module description template
143+
- Fix uninstall hook to clean up ``spp.*`` parameters (was using wrong
144+
``openspp.*`` prefix)
145+
- Remove global Apps menu override that forced OpenSPP filter on all
146+
users
147+
- Scope CSS branding selectors to login page context
148+
- Change ``/openspp/about`` endpoint from public to authenticated access
149+
- Remove empty placeholder view files (``login_templates.xml``,
150+
``backend_customization.xml``)
151+
- Remove missing ``banner.png`` reference from manifest
152+
- Add CSRF justification comment on ``/publisher-warranty`` endpoint
153+
128154
19.0.2.0.0
129155
~~~~~~~~~~
130156

spp_branding_kit/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ def uninstall_hook(env):
7272
"""
7373
_logger.info("OpenSPP Branding Kit: Running uninstall cleanup...")
7474

75-
# Remove all openspp.* configuration parameters
75+
# Remove all spp.* configuration parameters created by this module
7676
try:
7777
# nosemgrep: odoo-sudo-without-context — standard Odoo pattern for system parameter access
7878
IrConfigParam = env["ir.config_parameter"].sudo()
79-
params = IrConfigParam.search([("key", "=like", "openspp.%")])
79+
params = IrConfigParam.search([("key", "=like", "spp.%")])
8080
if params:
8181
param_count = len(params)
8282
params.unlink()

spp_branding_kit/__manifest__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# pylint: disable=pointless-statement
22
{
33
"name": "OpenSPP Branding Kit",
4-
"version": "19.0.2.0.0",
4+
"version": "19.0.2.0.1",
55
"summary": "Branding customization, URL routing and telemetry management for OpenSPP",
66
"author": "OpenSPP.org, OpenSPP Project",
77
"website": "https://github.com/OpenSPP/OpenSPP2",
88
"license": "LGPL-3",
9-
"category": "Theme/Backend",
10-
"development_status": "Beta",
9+
"category": "OpenSPP/Configuration",
10+
"development_status": "Production/Stable",
1111
"maintainers": ["jeremi", "gonzalesedwin1123"],
1212
"depends": [
1313
"spp_security",
@@ -24,9 +24,7 @@
2424
"data/debranding_data.xml",
2525
# Views - UI customizations
2626
"views/webclient_templates.xml",
27-
"views/login_templates.xml",
2827
"views/report_templates.xml",
29-
"views/backend_customization.xml",
3028
"views/res_config_settings_views.xml",
3129
"views/about_settings.xml",
3230
"views/ir_module_module_views.xml",
@@ -43,7 +41,6 @@
4341
},
4442
"images": [
4543
"static/description/icon.png",
46-
"static/description/banner.png",
4744
],
4845
"installable": True,
4946
"application": False,

spp_branding_kit/controllers/main.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from odoo import http
77
from odoo.http import request
8+
from odoo.modules import get_manifest
89

910
from odoo.addons.portal.controllers.web import Home
1011

@@ -47,24 +48,27 @@ def web_client(self, s_action=None, **kw):
4748
class OpenSPPBrandingController(http.Controller):
4849
"""Custom routes for OpenSPP branding"""
4950

50-
@http.route("/openspp/about", type="http", auth="public")
51+
@http.route("/openspp/about", type="http", auth="user")
5152
def openspp_about(self, **kwargs):
5253
"""Custom about page for OpenSPP"""
53-
return json.dumps(
54-
{
55-
"title": "About OpenSPP",
56-
"version": "1.0.0",
57-
"system_name": get_param(request.env, "spp.system.name", "OpenSPP Platform"),
58-
"documentation_url": get_param(request.env, "spp.documentation.url", "https://docs.openspp.org"),
59-
"support_url": get_param(request.env, "spp.support.url", "https://openspp.org"),
60-
}
61-
)
54+
manifest = get_manifest("spp_branding_kit")
55+
payload = {
56+
"title": "About OpenSPP",
57+
"version": manifest.get("version", "0.0.0"),
58+
"system_name": get_param(request.env, "spp.system.name", "OpenSPP Platform"),
59+
"documentation_url": get_param(request.env, "spp.documentation.url", "https://docs.openspp.org"),
60+
"support_url": get_param(request.env, "spp.support.url", "https://openspp.org"),
61+
}
62+
return Response(json.dumps(payload), content_type="application/json")
6263

6364
@http.route("/web/webclient/version_info", type="jsonrpc", auth="none")
6465
def version_info(self):
6566
"""Override version info to show OpenSPP branding"""
6667
return version_info_payload(request.env)
6768

69+
# csrf=False: This endpoint mimics Odoo's built-in telemetry route which receives
70+
# unauthenticated machine-to-machine POST requests from the Odoo client library.
71+
# CSRF protection does not apply to non-browser API endpoints.
6872
@http.route("/publisher-warranty", type="http", auth="none", csrf=False)
6973
def publisher_warranty(self, **kwargs):
7074
"""Handle telemetry based on configuration"""

spp_branding_kit/models/ir_module_module.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ class IrModuleModule(models.Model):
77
@api.model
88
def get_paid_apps_count(self):
99
"""Get count of paid apps in the system"""
10-
paid_apps = self.search(["|", ("license", "=like", "OEEL%"), ("license", "=like", "OPL%")])
11-
return len(paid_apps)
10+
return self.search_count(["|", ("license", "=like", "OEEL%"), ("license", "=like", "OPL%")])
1211

1312
# No overrides of install/upgrade/uninstall buttons are needed once
1413
# _search is left untouched; UI filtering is handled via web_* APIs.

spp_branding_kit/readme/DESCRIPTION.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Replaces Odoo branding with OpenSPP branding across the platform. Adds `/openspp
88
- Email signatures: replaces default Odoo signature with OpenSPP branding
99
- Report customization: updates company report headers and footers with OpenSPP text
1010
- Post-install debranding: disables Odoo brand promotion messages, update notification crons, and theme store menu
11-
- Module filtering: adds "OpenSPP Apps" menu to filter and view OpenSPP-specific applications
11+
- Module filtering: adds "OpenSPP Apps" filter and menu to view OpenSPP-specific applications
12+
- Debug restriction: optionally restricts debug mode access to administrators only
1213

1314
### Key Models
1415

@@ -25,8 +26,8 @@ This module does not introduce new models. It extends existing models:
2526

2627
After installing:
2728

28-
1. Open the **Settings** app
29-
2. Scroll to the **OpenSPP Branding** section (app card with OpenSPP icon)
29+
1. Open **Settings**
30+
2. Scroll to the **OpenSPP Branding** app card
3031
3. Configure **System Name** (default: "OpenSPP Platform")
3132
4. Set **Documentation URL** and **Support URL** for help links
3233
5. Toggle **Display OpenSPP Branding** to show/hide "Powered by OpenSPP"
@@ -35,13 +36,15 @@ After installing:
3536

3637
Post-install hook automatically disables Odoo brand promotion, module update notifications, and theme store menu.
3738

38-
### Menu Location
39+
### UI Location
3940

40-
- **Apps > OpenSPP Apps** - View and filter OpenSPP-specific applications
41+
- **Apps > OpenSPP Apps** — filtered view of OpenSPP-specific applications
42+
- **Settings > OpenSPP Branding** — branding and telemetry configuration
43+
- **Settings > General Settings > About** — OpenSPP platform information card
4144

4245
### Security
4346

44-
This module does not define security groups or access rights. Configuration access follows standard Odoo settings permissions (requires `base.group_system` - Settings access).
47+
This module does not define new security groups or access control entries. It extends existing models that already have ACLs. Configuration access requires `base.group_system` (Settings).
4548

4649
### Extension Points
4750

spp_branding_kit/readme/HISTORY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### 19.0.2.0.1
2+
3+
- Upgrade to Production/Stable status
4+
- Fix category to `OpenSPP/Configuration`
5+
- Use `search_count()` in `get_paid_apps_count()` for efficiency
6+
- Add proper JSON response content-type to `/openspp/about` endpoint
7+
- Clean up outdated `requirements.txt` referencing Odoo 17
8+
- Increase test coverage to 95%+ (utils, settings, controllers, HTTP endpoints)
9+
- Update `readme/DESCRIPTION.md` to follow module description template
10+
- Fix uninstall hook to clean up `spp.*` parameters (was using wrong `openspp.*` prefix)
11+
- Remove global Apps menu override that forced OpenSPP filter on all users
12+
- Scope CSS branding selectors to login page context
13+
- Change `/openspp/about` endpoint from public to authenticated access
14+
- Remove empty placeholder view files (`login_templates.xml`, `backend_customization.xml`)
15+
- Remove missing `banner.png` reference from manifest
16+
- Add CSRF justification comment on `/publisher-warranty` endpoint
17+
118
### 19.0.2.0.0
219

320
- Initial migration to OpenSPP2

spp_branding_kit/requirements.txt

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1 @@
1-
# ABOUTME: External dependencies and OCA modules required for OpenSPP Branding Kit
2-
# ABOUTME: Lists the OCA debranding modules that should be installed alongside this module
3-
4-
# OCA Server Brand Repository
5-
# Repository: https://github.com/OCA/server-brand
6-
# Branch: 17.0
7-
# Installation: Add this repository to your addons path
8-
9-
# Required OCA Modules for Odoo 17:
10-
# ====================================
11-
12-
# disable_odoo_online (17.0.1.0.0)
13-
# - Removes odoo.com bindings and telemetry
14-
# - Disables update notifier code
15-
# - Hides apps and updates menu items
16-
# Repository: https://github.com/OCA/server-brand/tree/17.0/disable_odoo_online
17-
18-
# portal_odoo_debranding (17.0.1.0.0)
19-
# - Removes Odoo branding from website portal
20-
# - Customizes frontend elements
21-
# Repository: https://github.com/OCA/server-brand/tree/17.0/portal_odoo_debranding
22-
23-
# remove_odoo_enterprise (17.0.1.0.1)
24-
# - Removes enterprise modules references
25-
# - Hides enterprise-specific settings
26-
# Repository: https://github.com/OCA/server-brand/tree/17.0/remove_odoo_enterprise
27-
28-
# hr_expense_remove_mobile_link (17.0.1.0.0) [Optional]
29-
# - Removes Odoo Enterprise mobile app download links
30-
# Repository: https://github.com/OCA/server-brand/tree/17.0/hr_expense_remove_mobile_link
31-
32-
# Installation Instructions:
33-
# ==========================
34-
# 1. Clone the OCA server-brand repository:
35-
# git clone --branch 17.0 https://github.com/OCA/server-brand.git
36-
#
37-
# 2. Add the path to your Odoo configuration file (odoo.conf):
38-
# addons_path = /path/to/server-brand,...
39-
#
40-
# 3. Update the __manifest__.py file to include these modules in dependencies:
41-
# 'depends': [
42-
# 'disable_odoo_online',
43-
# 'portal_odoo_debranding',
44-
# 'remove_odoo_enterprise',
45-
# ]
46-
#
47-
# 4. Install the openspp_branding_kit module through Odoo interface or CLI
48-
49-
# Python Dependencies (if any additional are needed)
50-
# ==================================================
51-
# None required beyond standard Odoo 17 dependencies
1+
# No external Python dependencies required

0 commit comments

Comments
 (0)