1、当检测到缺刀工单需要的功能刀具从刀具房出库到线边刀架时,更改cnc编程单的功能刀具状态为正常;
This commit is contained in:
@@ -115,6 +115,8 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
# 新刀入库到线边
|
||||
item.create_stock_move(pre_manufacturing_id, location_id)
|
||||
item.current_shelf_location_id = location_id.id
|
||||
# 对该刀进行校验(校验是否为制造订单所缺的刀)
|
||||
item.cnc_function_tool_use_verify()
|
||||
|
||||
# 中控反馈该位置没有刀
|
||||
else:
|
||||
@@ -255,6 +257,15 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
result['domain'] = [('id', '=', self.safe_inventory_id.id)]
|
||||
return result
|
||||
|
||||
def cnc_function_tool_use_verify(self):
|
||||
"""
|
||||
cnc程序用刀可用校验
|
||||
"""
|
||||
cnc_processing_ids = self.env['sf.cnc.processing'].search(
|
||||
[('tool_state', '=', '1'), ('cutting_tool_name', '=', self.tool_name_id.name)])
|
||||
if cnc_processing_ids:
|
||||
cnc_processing_ids.sudo().write({'tool_state': '0'})
|
||||
|
||||
def tool_inventory_displacement_out(self):
|
||||
"""
|
||||
机床当前刀库实时信息接口,功能刀具出库
|
||||
@@ -265,6 +276,10 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
self.create_stock_move(stock_location_id, False)
|
||||
self.current_location_id = stock_location_id.id
|
||||
self.current_shelf_location_id = False
|
||||
|
||||
if self.current_location_id.name == '刀具房':
|
||||
# 对该刀进行校验(校验是否为制造订单所缺的刀)
|
||||
self.cnc_function_tool_use_verify()
|
||||
# self.barcode_id.create_stock_quant(location_inventory_id, stock_location_id,
|
||||
# self.functional_tool_name_id.id, '机床装刀', self.functional_tool_name_id,
|
||||
# self.functional_tool_name_id.tool_groups_id)
|
||||
|
||||
@@ -10,8 +10,6 @@ class CNCprocessing(models.Model):
|
||||
_inherit = 'sf.cnc.processing'
|
||||
_description = 'CNC加工用刀检测'
|
||||
|
||||
tool_state = fields.Selection([('0', '正常'), ('1', '缺刀'), ('2', '无效刀')], string='刀具状态', default='0')
|
||||
|
||||
# ==========MES装刀指令接口==========
|
||||
# def register_cnc_processing(self, knife_plan):
|
||||
# config = self.env['res.config.settings'].get_values()
|
||||
|
||||
Reference in New Issue
Block a user