Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion website_odoo_debranding/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from . import models
from .hooks import post_init_hook
6 changes: 6 additions & 0 deletions website_odoo_debranding/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
"category": "Website",
"depends": ["website"],
"data": ["templates/disable_odoo.xml"],
"assets": {
"web.assets_backend": [
"website_odoo_debranding/static/src/client_actions/configurator.esm.js",
"website_odoo_debranding/static/src/components/website_loader.esm.js",
],
},
"installable": True,
"post_init_hook": "post_init_hook",
}
1 change: 1 addition & 0 deletions website_odoo_debranding/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import website
21 changes: 21 additions & 0 deletions website_odoo_debranding/models/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from odoo import api, models


class Website(models.Model):
_inherit = "website"

@api.model
def get_website_logo_url(self):
website = self.get_current_website()
logo_url = False
if website:
logo_url = f"url('/website/image/website/{website.id}/logo')"
default_logo = website._default_logo()
uses_default_logo = not website.logo or website.logo == default_logo
if uses_default_logo:
if not website.company_id.uses_default_logo:
logo_url = (
f"url('/website/image/res.company/"
f"{website.company_id.id}/logo')"
)
return logo_url
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import {
Configurator,DescriptionScreen,FeaturesSelectionScreen,PaletteSelectionScreen,ThemeSelectionScreen,WelcomeScreen
} from "@website/client_actions/configurator/configurator";
import {onMounted,onWillStart} from "@odoo/owl";
import {patch} from "@web/core/utils/patch";
import { useService } from "@web/core/utils/hooks";

patch(Configurator.prototype, {
setup() {
super.setup();
onMounted(this.onMounted);
onWillStart(async () => {
this.website_logo_url = await this.orm.call('website', 'get_website_logo_url')
})
},
async onMounted() {
// eslint-disable-next-line no-undef
var htmlTag = document.getElementsByClassName("o_configurator_odoo_logo");
htmlTag[0].style.setProperty('--configurator-logo',this.website_logo_url);
}

});

patch(WelcomeScreen.prototype, {
setup() {
super.setup();
onMounted(this.onMounted);
this.orm = useService('orm');
onWillStart(async () => {
this.website_logo_url = await this.orm.call('website', 'get_website_logo_url')
})
},
onMounted() {
// eslint-disable-next-line no-undef
var htmlTag = document.getElementsByClassName("o_configurator_odoo_logo");
htmlTag[0].style.setProperty('--configurator-logo',this.website_logo_url);
}
});

patch(DescriptionScreen.prototype, {
setup() {
super.setup();
onWillStart(async () => {
this.website_logo_url = await this.orm.call('website', 'get_website_logo_url')
})
},
onMounted() {
// eslint-disable-next-line no-undef
var htmlTag = document.getElementsByClassName("o_configurator_odoo_logo");
htmlTag[0].style.setProperty('--configurator-logo',this.website_logo_url);
super.onMounted();
}
});

patch(PaletteSelectionScreen.prototype, {
setup() {
super.setup();
onMounted(this.onMounted);
onWillStart(async () => {
this.website_logo_url = await this.orm.call('website', 'get_website_logo_url')
})
},
onMounted() {
// eslint-disable-next-line no-undef
var htmlTag = document.getElementsByClassName("o_configurator_odoo_logo");
htmlTag[0].style.setProperty('--configurator-logo',this.website_logo_url);
}
});

patch(FeaturesSelectionScreen.prototype, {
setup() {
super.setup();
onMounted(this.onMounted);
onWillStart(async () => {
this.website_logo_url = await this.orm.call('website', 'get_website_logo_url')
})
},
onMounted() {
// eslint-disable-next-line no-undef
var htmlTag = document.getElementsByClassName("o_configurator_odoo_logo");
htmlTag[0].style.setProperty('--configurator-logo',this.website_logo_url);
}
});

patch(ThemeSelectionScreen.prototype, {
setup() {
super.setup();
onMounted(this.onMounted);
onWillStart(async () => {
this.website_logo_url = await this.orm.call('website', 'get_website_logo_url')
})
},
onMounted() {
// eslint-disable-next-line no-undef
var htmlTag = document.getElementsByClassName("o_configurator_odoo_logo");
htmlTag[0].style.setProperty('--configurator-logo',this.website_logo_url);
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {onWillStart,useEffect} from "@odoo/owl";
import {
WebsiteLoader,
} from "@website/components/website_loader/website_loader";
import {patch} from "@web/core/utils/patch";
import { useService } from "@web/core/utils/hooks";

patch(WebsiteLoader.prototype, {
setup() {
super.setup();
this.orm = useService('orm');
onWillStart(async () => {
this.website_logo_url = await this.orm.call('website', 'get_website_logo_url')
});
useEffect(
(isVisible) => {
if (isVisible) {
// eslint-disable-next-line no-undef
var htmlTag = document.getElementsByClassName("o_website_loader_odoo_logo");
htmlTag[0].style.setProperty('--configurator-logo',this.website_logo_url);
}
},
() => [this.state.isVisible]
);
},
});
Loading