diff --git a/web_debranding/README.rst b/web_debranding/README.rst new file mode 100644 index 00000000..bea58c79 --- /dev/null +++ b/web_debranding/README.rst @@ -0,0 +1,32 @@ +================ +Web Debranding +================ + +This addon removes selected Odoo branding elements in the web backend. + +- Removes the About block from General Settings. +- Blanks the default browser tab title fallback (no "Odoo"). + +Usage +----- + +Install the module and open Settings to verify the About section is gone. +Open the web client and check the browser tab title no longer defaults to "Odoo". + +Bug Tracker +----------- + +If you encounter problems, please open an issue in the repository. + +Credits +------- + +Authors +~~~~~~~ + +- Odoo Community Association (OCA) + +Maintainers +~~~~~~~~~~~ + +This module is part of the OCA/server-brand project. diff --git a/web_debranding/__init__.py b/web_debranding/__init__.py new file mode 100644 index 00000000..b02b8b5f --- /dev/null +++ b/web_debranding/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2025 Milan Topuzov (https://milantopuzov.dev) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). diff --git a/web_debranding/__manifest__.py b/web_debranding/__manifest__.py new file mode 100644 index 00000000..8cdd6604 --- /dev/null +++ b/web_debranding/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2025 Milan Topuzov (https://milantopuzov.dev) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +{ + "name": "Web Debranding", + "summary": "Hide Odoo branding elements in web backend", + "version": "19.0.1.0.0", + "category": "Hidden", + "website": "https://github.com/OCA/server-brand", + "author": "Odoo Community Association (OCA)", + "license": "LGPL-3", + "depends": ["web", "base_setup"], + "data": [ + "views/res_config_settings_debrand.xml", + "views/web_layout_debrand.xml", + ], + "assets": {}, + "installable": True, +} diff --git a/web_debranding/pyproject.toml b/web_debranding/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/web_debranding/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_debranding/tests/__init__.py b/web_debranding/tests/__init__.py new file mode 100644 index 00000000..2ff9942f --- /dev/null +++ b/web_debranding/tests/__init__.py @@ -0,0 +1,11 @@ +"""Tests package for web_debranding. + +This package follows the same pattern as other modules in this repo, +importing local test modules so Odoo test discovery can load them. +""" + +# Copyright 2025 Milan Topuzov (https://milantopuzov.dev) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from . import test_web_debranding +from . import test_title_debranding diff --git a/web_debranding/tests/test_title_debranding.py b/web_debranding/tests/test_title_debranding.py new file mode 100644 index 00000000..28719100 --- /dev/null +++ b/web_debranding/tests/test_title_debranding.py @@ -0,0 +1,57 @@ +# Copyright 2025 Milan Topuzov (https://milantopuzov.dev) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from lxml import html + +from odoo import http +from odoo.tests import common + + +class _DummyRequest: + class _Session: + def __init__(self, debug=""): + self.debug = debug + + def __init__(self, debug=""): + # Minimal session object with a 'debug' attribute + self.session = self._Session(debug=debug) + + def csrf_token(self, _): + # Minimal CSRF call used by web.layout + return "" + + +class TestWebDebrandingTitle(common.TransactionCase): + def setUp(self): + super().setUp() + # Bind a dummy request into the http local stack so that the + # `odoo.http.request` LocalProxy resolves during QWeb evaluation. + self._dummy_request = _DummyRequest() + http._request_stack.push(self._dummy_request) + self.addCleanup(lambda: http._request_stack.pop()) + + def test_web_layout_title_no_fallback(self): + """web.layout should not fallback to 'Odoo' when no title is provided. + + Our view inherit replaces the