31 lines
883 B
Python
31 lines
883 B
Python
# -*- coding: utf-8 -*-
|
|
# Copyright 2025 Sveltware Solutions
|
|
|
|
from odoo import fields, models
|
|
|
|
|
|
class ResUsersSettings(models.Model):
|
|
_inherit = 'res.users.settings'
|
|
|
|
# 确保 ps_data 字段存在(如果 udoo_om_ux 未安装)
|
|
ps_data = fields.Serialized()
|
|
|
|
# 多标签页配置
|
|
ps_show_tabbar_single = fields.Selection(
|
|
[('on', 'On'), ('off', 'Off')],
|
|
sparse='ps_data',
|
|
default='on',
|
|
string='Show tabbar when single tab'
|
|
)
|
|
ps_close_last_tab = fields.Selection(
|
|
[('on', 'On'), ('off', 'Off')],
|
|
sparse='ps_data',
|
|
default='on',
|
|
string='Allow closing last tab'
|
|
)
|
|
ps_last_tab_close_action = fields.Selection([
|
|
('placeholder', 'Show placeholder'),
|
|
('home', 'Go to home')
|
|
], sparse='ps_data', default='placeholder', string='Action when closing last tab')
|
|
|