Skip to content

Commit

Permalink
[ADD] module survey_odoo_debranding
Browse files Browse the repository at this point in the history
- remove Powered by Odoo into survey website
  • Loading branch information
mathben committed Nov 15, 2024
1 parent 471d0e0 commit f59ac18
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 0 deletions.
3 changes: 3 additions & 0 deletions survey_odoo_debranding/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from .hooks import post_init_hook
14 changes: 14 additions & 0 deletions survey_odoo_debranding/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2016 Tecnativa, S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Remove Odoo Branding from Survey",
"version": "16.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/survey",
"license": "AGPL-3",
"category": "Marketing/Surveys",
"depends": ["survey"],
"data": ["templates/disable_odoo.xml"],
"installable": True,
"post_init_hook": "post_init_hook",
}
20 changes: 20 additions & 0 deletions survey_odoo_debranding/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2020 Alexandre Díaz - Tecnativa S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import SUPERUSER_ID, api
from odoo.tools import config


def post_init_hook(cr, registry):
# This is here to not broke the tests. The idea:
# - XML changes in website are made using 'customize_show=True'
# - When Odoo is running in testing mode, we disable our changes
# - When run our test, we enable the changes and test it. (see test file)
#
# For the user it has no impact (only more customizable options in the website)
# For CI/CD avoids problems testing modules that removes/positioning elements
# that other modules uses in their tests.
if config["test_enable"] or config["test_file"]:
env = api.Environment(cr, SUPERUSER_ID, {})
env.ref(
"survey_odoo_debranding.frontend_layout_remove_brand"
).active = False
3 changes: 3 additions & 0 deletions survey_odoo_debranding/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `TechnoLibre <https://technolibre.ca>`_:

* Mathieu Benoit
3 changes: 3 additions & 0 deletions survey_odoo_debranding/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module remove Odoo branding on survey:

* Remove "Powered by Odoo" from footer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions survey_odoo_debranding/templates/disable_odoo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Remove "Powered by Odoo" -->
<template
id="frontend_layout_remove_brand"
inherit_id="survey.layout"
customize_show="True"
name="Remove Odoo Promotional Link"
priority="999"
>
<xpath
expr="//div[hasclass('o_survey_brand_message')]/div[hasclass('d-inline-block')]"
position="replace"
/>
</template>
</odoo>

0 comments on commit f59ac18

Please sign in to comment.