43 lines
1.8 KiB
Python
43 lines
1.8 KiB
Python
from odoo import models, fields, api
|
|
|
|
|
|
class ResConfigSettings(models.TransientModel):
|
|
_inherit = 'res.config.settings'
|
|
|
|
agv_rcs_url = fields.Char(string='avg_rcs访问地址',
|
|
default='http://172.16.10.114:8182/rcms/services/rest/hikRpcService/genAgvSchedulingTask')
|
|
wbcode = fields.Char('地码')
|
|
agv_code = fields.Char(string='agv编号')
|
|
task_type_no = fields.Char('任务单类型编号')
|
|
|
|
is_agv_task_dispatch = fields.Boolean('是否下发AGV任务', default=False)
|
|
# 是否重新获取检测文件
|
|
is_get_detection_file = fields.Boolean(string='重新获取检测文件', default=False)
|
|
|
|
@api.model
|
|
def get_values(self):
|
|
values = super(ResConfigSettings, self).get_values()
|
|
config = self.env['ir.config_parameter'].sudo()
|
|
agv_rcs_url = config.get_param('agv_rcs_url', default='')
|
|
wbcode = config.get_param('wbcode', default='')
|
|
agv_code = config.get_param('agv_code', default='')
|
|
is_agv_task_dispatch = config.get_param('is_agv_task_dispatch')
|
|
is_get_detection_file = config.get_param('is_get_detection_file')
|
|
values.update(
|
|
agv_rcs_url=agv_rcs_url,
|
|
wbcode=wbcode,
|
|
agv_code=agv_code,
|
|
is_agv_task_dispatch=is_agv_task_dispatch,
|
|
is_get_detection_file=is_get_detection_file
|
|
)
|
|
return values
|
|
|
|
def set_values(self):
|
|
super(ResConfigSettings, self).set_values()
|
|
config = self.env['ir.config_parameter'].sudo()
|
|
config.set_param("agv_rcs_url", self.agv_rcs_url or "")
|
|
config.set_param("wbcode", self.wbcode or "")
|
|
config.set_param("agv_code", self.agv_code or "")
|
|
config.set_param("is_agv_task_dispatch", self.is_agv_task_dispatch or False)
|
|
config.set_param("is_get_detection_file", self.is_get_detection_file or False)
|