优化sf获取cnc程序和ftp
This commit is contained in:
@@ -12,8 +12,12 @@ class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
token = fields.Char(string='TOKEN', default='b811ac06-3f00-11ed-9aed-0242ac110003')
|
||||
sf_secret_key = fields.Char(string='密钥', default= 'wBmxej38OkErKhD6')
|
||||
sf_url = fields.Char(string='访问地址', default= 'https://sf.cs.jikimo.com')
|
||||
sf_secret_key = fields.Char(string='密钥', default='wBmxej38OkErKhD6')
|
||||
sf_url = fields.Char(string='访问地址', default='https://sf.cs.jikimo.com')
|
||||
ftp_host = fields.Char(string='FTP的ip')
|
||||
ftp_port = fields.Char(string='FTP端口')
|
||||
ftp_user = fields.Char(string='FTP用户')
|
||||
ftp_password = fields.Char(string='FTP密码')
|
||||
|
||||
def sf_all_sync(self):
|
||||
self.env['sf.production.materials'].sync_all_production_materials()
|
||||
@@ -40,8 +44,6 @@ class ResConfigSettings(models.TransientModel):
|
||||
_logger.info("同步资源库刀具")
|
||||
# self.env['sf.processing.order'].sync_all_processing_order()
|
||||
|
||||
|
||||
|
||||
@api.model
|
||||
def get_values(self):
|
||||
"""
|
||||
@@ -53,11 +55,19 @@ class ResConfigSettings(models.TransientModel):
|
||||
token = config.get_param('token', default='')
|
||||
sf_secret_key = config.get_param('sf_secret_key', default='')
|
||||
sf_url = config.get_param('sf_url', default='')
|
||||
ftp_host = config.get_param('ftp_host', default='')
|
||||
ftp_port = config.get_param('ftp_port', default='')
|
||||
ftp_user = config.get_param('ftp_user', default='')
|
||||
ftp_password = config.get_param('ftp_password', default='')
|
||||
|
||||
values.update(
|
||||
token=token,
|
||||
sf_secret_key=sf_secret_key,
|
||||
sf_url=sf_url,
|
||||
ftp_host=ftp_host,
|
||||
ftp_port=ftp_port,
|
||||
ftp_user=ftp_user,
|
||||
ftp_password=ftp_password
|
||||
)
|
||||
return values
|
||||
|
||||
@@ -67,4 +77,7 @@ class ResConfigSettings(models.TransientModel):
|
||||
ir_config.set_param("token", self.token or "")
|
||||
ir_config.set_param("sf_secret_key", self.sf_secret_key or "")
|
||||
ir_config.set_param("sf_url", self.sf_url or "")
|
||||
|
||||
ir_config.set_param("ftp_host", self.ftp_host or "")
|
||||
ir_config.set_param("ftp_port", self.ftp_port or "")
|
||||
ir_config.set_param("ftp_user", self.ftp_user or "")
|
||||
ir_config.set_param("ftp_password", self.ftp_password or "")
|
||||
|
||||
Reference in New Issue
Block a user