1、删除功能刀具组装模型的打印二维码按钮,隐藏组装单打印按钮;2、添加功能刀具组装时的rfid验重功能;

This commit is contained in:
yuxianghui
2024-02-20 14:27:43 +08:00
parent cb8285d0ca
commit 0183a5ab2b
3 changed files with 23 additions and 24 deletions

View File

@@ -445,6 +445,21 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if obj.after_assembly_functional_tool_length == 0:
raise ValidationError('组装参数信息【伸出长】不能为0')
@api.constrains('rfid')
def _check_rfid(self):
self.get_rfid()
@api.onchange('rfid')
def _onchange_rfid(self):
self.get_rfid()
def get_rfid(self):
for obj in self:
if obj.rfid:
tool_entity = self.env['sf.functional.cutting.tool.entity'].sudo().search([('rfid', '=', obj.rfid)])
if tool_entity:
raise ValidationError('%s】的rfid已被使用请重新录入' % obj.rfid)
def functional_tool_assembly(self):
"""
功能刀具组装