Greasy Fork is available in English.
Ensures the Odoo interface always uses the dark theme.
// ==UserScript==
// @name Odoo Always Dark
// @description Ensures the Odoo interface always uses the dark theme.
// @namespace github.com/brcut-odoo
// @author brcut-odoo
// @license MIT
// @version 0.0.1
// @match http://*/odoo*
// @match https://*/odoo*
// @icon https://www.google.com/s2/favicons?sz=64&domain=odoo.com
// @grant none
// ==/UserScript==
odoo.define("odoo_always_dark", ["@web/core/utils/patch", "@web/core/browser/cookie", "@web_enterprise/webclient/color_scheme/color_scheme_service"], (require) => {
'use strict'
const { patch } = require("@web/core/utils/patch")
const { cookie } = require("@web/core/browser/cookie")
const { colorSchemeService } = require("@web_enterprise/webclient/color_scheme/color_scheme_service")
patch(colorSchemeService, {
async start(...args) {
const res = await super.start(...args)
if (cookie.get("color_scheme") !== "dark") {
res.switchToColorScheme("dark")
}
return res
}
})
return {}
})