增加合并下发向导,增加cnc模型的缺省tree视图

This commit is contained in:
mgw
2023-02-23 08:52:56 +08:00
parent d81cf77bbe
commit 28659bfc95
13 changed files with 260 additions and 9 deletions

View File

@@ -23,7 +23,6 @@ _logger = logging.getLogger(__name__)
class FtpButton(models.Model):
_inherit = 'sf.cnc.processing'
button_state = fields.Boolean(string='是否已经下发')
user_permissions = fields.Boolean(string='权限', related='workorder_id.user_permissions')
state = fields.Selection(string='状态', related='workorder_id.state')
@@ -301,12 +300,13 @@ class WorkCenterBarcode(models.Model):
# 存在本地的文件下发到机床
_logger.info("=====================11================")
ftp.upload_file(remotepath=file_path_remote, localpath=file_path_local)
item.button_state = True
# _logger.info("=====================22================")
except Exception as e:
_logger.info("=====================================", e)
raise UserError('NC下发执行超时, 请检查下发状态')
# 下发都执行完毕后按钮标志位变为true
self.button_up_all_state = True
# # 下发都执行完毕后按钮标志位变为true
# self.cnc_ids.button_state = True
def get__state(self):
pay_time = str(datetime.now())
@@ -338,3 +338,16 @@ class WorkCenterBarcode(models.Model):
}
url = 'https://bfm.cs.jikimo.com/api/get/state'
requests.post(url, json=json, data=None)
def action_up_select(self):
return {
'name': '选择要下发的程序文件',
'view_mode': 'tree,form',
# 'res_model': self._name,
'res_model': 'sf_tray_form_inherit',
'target': 'main', # 打开方式
# 'domain': [('project_num', '=', self.project_num), ('state', '=', 'done')], # 域
'type': 'ir.actions.act_window', # 返回的类型
}