mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix xml error
This commit is contained in:
@@ -41,28 +41,28 @@ export class WebEnvironmentRibbon extends Component {
|
||||
}
|
||||
|
||||
showRibbon() {
|
||||
const ribbon = $(".test-ribbon");
|
||||
const ribbon = document.querySelector('.test-ribbon');
|
||||
const self = this;
|
||||
ribbon.hide();
|
||||
ribbon.classList.add('o_hidden');
|
||||
// Get ribbon data from backend
|
||||
self.orm
|
||||
.call("web.environment.ribbon.backend", "get_environment_ribbon")
|
||||
.then(function (ribbon_data) {
|
||||
// Ribbon name
|
||||
if (ribbon_data.name && ribbon_data.name !== "False") {
|
||||
ribbon.show();
|
||||
ribbon.classList.remove('o_hidden');
|
||||
ribbon.html(ribbon_data.name);
|
||||
}
|
||||
// Ribbon color
|
||||
if (ribbon_data.color && self.validStrColour(ribbon_data.color)) {
|
||||
ribbon.css("color", ribbon_data.color);
|
||||
ribbon.style.color = ribbon_data.color;
|
||||
}
|
||||
// Ribbon background color
|
||||
if (
|
||||
ribbon_data.background_color &&
|
||||
self.validStrColour(ribbon_data.background_color)
|
||||
) {
|
||||
ribbon.css("background-color", ribbon_data.background_color);
|
||||
ribbon.style.backgroundColor = ribbon_data.background_color;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { UserMenu } from "@web/webclient/user_menu/user_menu";
|
||||
import { routeToUrl } from "@web/core/browser/router_service";
|
||||
import { router } from "@web/core/browser/router";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
import { registry } from "@web/core/registry";
|
||||
@@ -17,7 +17,6 @@ patch(UserMenu.prototype, {
|
||||
|
||||
"use strict";
|
||||
// this.companyService = useService("company");
|
||||
this.rpc = useService("rpc");
|
||||
this.orm = useService("orm");
|
||||
this.app_show_lang = session.app_show_lang;
|
||||
this.app_lang_list = session.app_lang_list;
|
||||
@@ -111,7 +110,7 @@ function debugItem(env) {
|
||||
id: "debug",
|
||||
description: _t("Activate the developer mode"),
|
||||
callback: () => {
|
||||
browser.location.search = "?debug=1";
|
||||
router.pushState({ debug: 1 }, { reload: true });
|
||||
},
|
||||
sequence: 5,
|
||||
};
|
||||
@@ -123,7 +122,7 @@ function activateAssetsDebugging(env) {
|
||||
type: "item",
|
||||
description: _t("Activate Assets Debugging"),
|
||||
callback: () => {
|
||||
browser.location.search = "?debug=assets";
|
||||
router.pushState({ debug: 'assets' }, { reload: true });
|
||||
},
|
||||
sequence: 6,
|
||||
};
|
||||
@@ -135,9 +134,7 @@ function leaveDebugMode(env) {
|
||||
type: "item",
|
||||
description: _t("Leave the Developer Tools"),
|
||||
callback: () => {
|
||||
const route = env.services.router.current;
|
||||
route.search.debug = "";
|
||||
browser.location.href = browser.location.origin + routeToUrl(route);
|
||||
router.pushState({ debug: 0 }, { reload: true });
|
||||
},
|
||||
sequence: 7,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user