Files
enterprise-addons/web_enterprise/models/res_users_settings.py
T

22 lines
636 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResUsersSettings(models.Model):
_inherit = 'res.users.settings'
homemenu_config = fields.Json(string="Home Menu Configuration", readonly=True)
color_scheme = fields.Selection(
[("system", "System"), ("light", "Light"), ("dark", "Dark")],
default="system",
required=True,
string="Color Scheme",
)
def write(self, vals):
if not vals.get("color_scheme", "system"):
vals.pop("color_scheme")
return super().write(vals)