控制按钮显隐逻辑

This commit is contained in:
mgw
2024-04-15 13:39:58 +08:00
parent 65330b083b
commit 9df62129b7
2 changed files with 7 additions and 4 deletions

View File

@@ -118,6 +118,8 @@ class ResMrpWorkOrder(models.Model):
inspection_user_id = fields.Many2one('res.users', string='检测人')
# 保存名称
save_name = fields.Char(string='检测文件保存名称', compute='_compute_save_name')
# 获取数据状态
data_state = fields.Boolean(string='获取数据状态', default=False)
@api.depends('production_id')
def _compute_save_name(self):
@@ -326,6 +328,8 @@ class ResMrpWorkOrder(models.Model):
else:
raise UserError('PT10点未测或数据错误')
self.data_state = True
return True
# ftp.download_file('three_check_datas.xls', '/home/ftpuser/three_check_datas.xls')