23 lines
781 B
Python
23 lines
781 B
Python
# -*- coding: utf-8 -*-
|
|
from odoo import api, fields, models, modules
|
|
|
|
|
|
class ResConfigSettings(models.TransientModel):
|
|
_inherit = 'res.config.settings'
|
|
|
|
style = fields.Selection([('default', '默认'), ('left', '居左'), ('right', '居右')], string="登录位置", help='选择背景对齐')
|
|
|
|
@api.model
|
|
def get_values(self):
|
|
res = super(ResConfigSettings, self).get_values()
|
|
res.update(
|
|
style=self.env['ir.config_parameter'].sudo().get_param('login_background.style'),
|
|
)
|
|
return res
|
|
|
|
def set_values(self):
|
|
super(ResConfigSettings, self).set_values()
|
|
param = self.env['ir.config_parameter'].sudo()
|
|
set_style = self.style or False
|
|
param.set_param('login_background.style', set_style)
|