新增对寿命未到期且位置在线边刀库的功能刀具进行拆解时,不直接报错,而是进行二次确认是否进行拆除。
This commit is contained in:
@@ -1437,14 +1437,26 @@ class FunctionalToolDismantle(models.Model):
|
||||
def confirmation_disassembly(self):
|
||||
logging.info('%s刀具确认开始拆解' % self.dismantle_cause)
|
||||
code = self.code
|
||||
context = self.env.context
|
||||
if self.functional_tool_id.functional_tool_status == '已拆除':
|
||||
raise ValidationError('Rfid为【%s】名称为【%s】的功能刀具已经拆解,请勿重复操作!' % (
|
||||
self.functional_tool_id.rfid_dismantle, self.name))
|
||||
# 对拆解的功能刀具进行校验,只有在刀具房的功能刀具才能拆解
|
||||
elif self.functional_tool_id.functional_tool_status != '报警':
|
||||
if self.functional_tool_id.tool_room_num == 0:
|
||||
if self.functional_tool_id.current_location == '机内刀库':
|
||||
raise ValidationError('Rfid为【%s】的功能刀具当前位置为【%s】,不能进行拆解!' % (
|
||||
self.rfid, self.functional_tool_id.current_location))
|
||||
elif not context.get('TRUE_DISASSEMBLE') and self.functional_tool_id.current_location == '线边刀库':
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'sf.functional.tool.dismantle.wiard',
|
||||
'name': '刀具寿命未到期',
|
||||
'view_mode': 'form',
|
||||
'target': 'new',
|
||||
'context': {
|
||||
'default_functional_tool_dismantle_id': self.id,
|
||||
'TRUE_DISASSEMBLE': True}
|
||||
}
|
||||
# 目标重复校验
|
||||
self.location_duplicate_check()
|
||||
datas = {'scrap': [], 'picking': []}
|
||||
|
||||
Reference in New Issue
Block a user