1、优化中控接口14-16
This commit is contained in:
@@ -692,6 +692,15 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
names = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
||||
return categories.browse(names)
|
||||
|
||||
@api.onchange('plan_execute_status')
|
||||
def _onchange_plan_execute_status(self):
|
||||
for record in self:
|
||||
if record.plan_execute_status == '已完成':
|
||||
self.env['sf.cnc.processing'].register_cnc_processing(record)
|
||||
|
||||
def knife_plan_cnc_processing(self):
|
||||
self.env['sf.cnc.processing'].register_cnc_processing(self)
|
||||
|
||||
def apply_for_tooling(self):
|
||||
"""
|
||||
申请装刀
|
||||
@@ -757,13 +766,12 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
if functional_tools:
|
||||
for functional_tool in functional_tools:
|
||||
if functional_tool.on_tool_stock_num == 0:
|
||||
# self.env['sf.cnc.processing'].register_cnc_processing(cnc_processing)
|
||||
if functional_tool.tool_stock_num == 0 and functional_tool.side_shelf_num == 0:
|
||||
status = True
|
||||
else:
|
||||
status = True
|
||||
if status:
|
||||
self.env['sf.cam.work.order.program.knife.plan'].sudo().create({
|
||||
knife_plan = self.env['sf.cam.work.order.program.knife.plan'].sudo().create({
|
||||
'name': cnc_processing.workorder_id.production_id.name,
|
||||
'cam_procedure_code': cnc_processing.program_name,
|
||||
'filename': cnc_processing.cnc_id.name,
|
||||
@@ -778,6 +786,8 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
'shank_model': cnc_processing.cutting_tool_handle_type,
|
||||
'estimated_processing_time': cnc_processing.estimated_processing_time,
|
||||
})
|
||||
# 创建装刀请求
|
||||
knife_plan.apply_for_tooling()
|
||||
|
||||
|
||||
class FunctionalToolAssembly(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user