39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
import logging
|
|
from odoo import api, fields, models
|
|
|
|
_logger = logging.getLogger(__name__)
|
|
|
|
|
|
class ResBFMConfigSettings(models.TransientModel):
|
|
_inherit = 'res.config.settings'
|
|
|
|
# bfm_url = fields.Selection(
|
|
# [("https://bfm.cs.jikimo.com", "开发环境(https://bfm.cs.jikimo.com)"),
|
|
# ("https://bfm.t.jikimo.com", "测试环境(https://bfm.t.jikimo.com)"),
|
|
# ("https://bfm.r.jikimo.com", "预发布环境(https://bfm.r.jikimo.com)"),
|
|
# # ("正式环境", "https://bfm.jikimo.com")], string='bfm环境', store=True)
|
|
# ("https://bfm.jikimo.com", "正式环境(https://bfm.jikimo.com)")], string='bfm环境', store=True)
|
|
|
|
bfm_url_new = fields.Char('业务平台环境路径', placeholder='请输入当前对应的业务平台环境路径')
|
|
|
|
@api.model
|
|
def get_values(self):
|
|
"""
|
|
重载获取参数的方法,参数都存在系统参数中
|
|
:return:
|
|
"""
|
|
values = super(ResBFMConfigSettings, self).get_values()
|
|
config = self.env['ir.config_parameter'].sudo()
|
|
bfm_url_new = config.get_param('bfm_url_new', default='')
|
|
|
|
values.update(
|
|
bfm_url_new=bfm_url_new,
|
|
)
|
|
return values
|
|
|
|
def set_values(self):
|
|
super(ResBFMConfigSettings, self).set_values()
|
|
ir_config = self.env['ir.config_parameter'].sudo()
|
|
ir_config.set_param("bfm_url_new", self.bfm_url_new or "")
|