控制按钮显隐逻辑
This commit is contained in:
@@ -118,6 +118,8 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
inspection_user_id = fields.Many2one('res.users', string='检测人')
|
inspection_user_id = fields.Many2one('res.users', string='检测人')
|
||||||
# 保存名称
|
# 保存名称
|
||||||
save_name = fields.Char(string='检测文件保存名称', compute='_compute_save_name')
|
save_name = fields.Char(string='检测文件保存名称', compute='_compute_save_name')
|
||||||
|
# 获取数据状态
|
||||||
|
data_state = fields.Boolean(string='获取数据状态', default=False)
|
||||||
|
|
||||||
@api.depends('production_id')
|
@api.depends('production_id')
|
||||||
def _compute_save_name(self):
|
def _compute_save_name(self):
|
||||||
@@ -326,6 +328,8 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
else:
|
else:
|
||||||
raise UserError('PT10点未测或数据错误')
|
raise UserError('PT10点未测或数据错误')
|
||||||
|
|
||||||
|
self.data_state = True
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# ftp.download_file('three_check_datas.xls', '/home/ftpuser/three_check_datas.xls')
|
# ftp.download_file('three_check_datas.xls', '/home/ftpuser/three_check_datas.xls')
|
||||||
|
|||||||
@@ -403,12 +403,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 col-lg-6 o_setting_box">
|
<div class="col-12 col-lg-6 o_setting_box">
|
||||||
|
<field name="data_state" invisible="1"/>
|
||||||
<button type="object" class="oe_highlight" name="get_three_check_datas" string="获取数据"
|
<button type="object" class="oe_highlight" name="get_three_check_datas" string="获取数据"
|
||||||
attrs='{"invisible": ["|","|",("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False)]}'/>
|
attrs='{"invisible": ["|", "|", "|", ("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False), ("data_state", "=", True)]}'/>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<button type="object" class="oe_highlight" name="getcenter" string="计算定位"
|
<button type="object" class="oe_highlight" name="getcenter" string="计算定位"
|
||||||
attrs='{"invisible": ["|","|",("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False)]}'/>
|
attrs='{"invisible": ["|","|", "|",("material_center_point","!=",False),("state","!=","progress"),("user_permissions","=",False), ("data_state", "=", False)]}'/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<group>
|
<group>
|
||||||
|
|||||||
Reference in New Issue
Block a user