Skip to content

Commit ebfc88f

Browse files
committed
fix(spp_branding_kit): remove debug mode restriction to fix singleton error
Remove the debug mode admin-only restriction feature from the branding module as it was causing "Expected singleton: res.users()" errors when accessing /web?debug=1 without authentication. This feature doesn't belong in a branding module and should be handled by proper security/access controls. Changes: - Remove debug mode check from web_client controller method - Remove openspp_debug_admin_only field from settings model - Remove debug mode setting from configuration UI - Remove debug_admin_only from session info - Update documentation to reflect removed feature
1 parent c950e77 commit ebfc88f

File tree

5 files changed

+3
-32
lines changed

5 files changed

+3
-32
lines changed

spp_branding_kit/controllers/main.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@ class OpenSPPHome(Home):
1414

1515
@http.route()
1616
def web_client(self, s_action=None, **kw):
17-
"""Override web client to enforce debug mode restrictions"""
18-
# Check if debug mode is restricted to admins BEFORE rendering
19-
if kw.get("debug", False):
20-
config_parameter = request.env["ir.config_parameter"].sudo()
21-
debug_admin_only = config_parameter.get_param("openspp.debug_admin_only", "True") == "True"
22-
23-
if debug_admin_only and request.session.uid:
24-
# Check if current user is admin
25-
if not request.env.user._is_admin():
26-
# Remove debug parameter and redirect
27-
kw.pop("debug", None)
28-
return request.redirect("/web", 303)
29-
17+
"""Override web client for branding"""
3018
return super().web_client(s_action, **kw)
3119

3220

spp_branding_kit/models/ir_http.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def session_info(self):
3030
"openspp_telemetry_endpoint": IrConfig.get_param(
3131
"openspp.telemetry_endpoint", "https://telemetry.openspp.org"
3232
),
33-
"openspp_debug_admin_only": IrConfig.get_param("openspp.debug_admin_only", "True") == "True",
3433
}
3534
)
3635

spp_branding_kit/models/res_config_settings.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ class ResConfigSettings(models.TransientModel):
5151
config_parameter="openspp.telemetry_endpoint",
5252
)
5353

54-
openspp_debug_admin_only = fields.Boolean(
55-
"Admin-Only Debug Mode",
56-
help="Limit debug mode access to administrators",
57-
default=True,
58-
config_parameter="openspp.debug_admin_only",
59-
)
60-
6154
openspp_hide_odoo_referral = fields.Boolean(
6255
"OpenSPP Interface Mode",
6356
help="Optimize interface for OpenSPP-specific workflows",

spp_branding_kit/readme/DESCRIPTION.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The **OpenSPP Branding Kit** module is designed to:
99
* **Apply OpenSPP Branding**: Replace removed Odoo branding with OpenSPP-specific branding elements, including logos, colors, text, and system information.
1010
* **Control Telemetry and External Communications**: Provide administrators with control over telemetry data collection and external service communications.
1111
* **Hide Paid Applications**: Optionally filter out enterprise and paid Odoo applications from the Apps menu to focus on open-source modules.
12-
* **Customize System Behavior**: Offer configuration options for debug mode access, system naming, documentation URLs, and support links.
12+
* **Customize System Behavior**: Offer configuration options for system naming, documentation URLs, and support links.
1313

1414
## Dependencies and Integration
1515

@@ -23,15 +23,14 @@ The **OpenSPP Branding Kit** module is designed to:
2323
* **Configuration Management ([ir.config_parameter](ir.config_parameter))**:
2424
* Introduces system-wide configuration parameters with the `openspp.*` prefix for centralized branding control.
2525
* Provides settings for system name, documentation URLs, support links, and telemetry endpoints.
26-
* Enables toggle options for features like hiding paid apps and restricting debug mode access.
26+
* Enables toggle options for features like hiding paid apps.
2727

2828
* **Module Filtering ([ir.module.module](ir.module.module))**:
2929
* Implements intelligent filtering of paid applications (OEEL and OPL licensed modules) from the Apps menu.
3030
* Maintains visibility of paid modules in administrative views while hiding them from the standard Apps interface.
3131
* Provides helper methods for counting and filtering paid applications.
3232

3333
* **Web Interface Customization**:
34-
* Customizes the web client to enforce debug mode restrictions based on user permissions.
3534
* Provides custom routes for OpenSPP-specific information pages.
3635
* Modifies session information to include OpenSPP branding data.
3736
* Implements telemetry redirection to OpenSPP endpoints when enabled.
@@ -50,7 +49,6 @@ The **OpenSPP Branding Kit** module is designed to:
5049
* **Security and Privacy Features**:
5150
* Disables unnecessary telemetry and external communications by default.
5251
* Removes promotional content and enterprise upselling elements.
53-
* Provides administrator-only debug mode option for enhanced security.
5452
* Implements proper permission controls for branding configuration.
5553

5654
## Module Components
@@ -73,7 +71,6 @@ The module provides various configuration parameters that can be adjusted throug
7371

7472
* `openspp.system_name`: Custom system name displayed throughout the interface
7573
* `openspp.hide_paid_apps`: Toggle to hide paid applications from the Apps menu
76-
* `openspp.debug_admin_only`: Restrict debug mode access to administrators only
7774
* `openspp.telemetry_enabled`: Enable or disable telemetry data collection
7875
* `openspp.documentation_url`: Custom documentation URL for help links
7976
* `openspp.support_url`: Custom support URL for assistance

spp_branding_kit/views/res_config_settings_views.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@
5252
/>
5353
</setting>
5454
</block>
55-
56-
<block title="Security" name="openspp_security_block">
57-
<setting help="Limit debug mode access to system administrators">
58-
<field name="openspp_debug_admin_only" />
59-
</setting>
60-
</block>
6155
</app>
6256
</xpath>
6357
</field>

0 commit comments

Comments
 (0)