1、刀具管理-机床换刀申请、CAM工单程序用刀计划、功能刀具组装增加了机床、功能刀具和功能刀具类型字段的关联关系,增加了tree视图功能按键 2、优化了CAM工单程序用刀计划的按键功能 3、对三个对象的字段的可读性进行了调整
This commit is contained in:
@@ -123,20 +123,20 @@ class FunctionalToolWarning(models.Model):
|
||||
image = fields.Binary('图片', readonly=True)
|
||||
|
||||
# 功能刀具预警 特有字段
|
||||
install_tool_time = fields.Char("装刀时间", readonly=True)
|
||||
outbound_time = fields.Char('出库时间', readonly=True)
|
||||
on_board_time = fields.Char('上机时间', readonly=True)
|
||||
machine_tool_code = fields.Char('机台号', readonly=True)
|
||||
cutting_tool_code = fields.Char('刀位号', readonly=True)
|
||||
idle_time = fields.Char('闲置时长', readonly=True)
|
||||
alarm_value = fields.Char('报警值', readonly=True)
|
||||
used_value = fields.Char('已使用值', readonly=True)
|
||||
alarm_type = fields.Char('报警类型', readonly=True)
|
||||
alarm_time = fields.Char('报警时间', readonly=True)
|
||||
dispose_user = fields.Char('处理人', readonly=True)
|
||||
dispose_time = fields.Char('处理时间', readonly=True)
|
||||
dispose_func = fields.Char('处理方法/措施', readonly=True)
|
||||
remark = fields.Char('备注', readonly=True)
|
||||
install_tool_time = fields.Char("装刀时间", readonly=False)
|
||||
outbound_time = fields.Char('出库时间', readonly=False)
|
||||
on_board_time = fields.Char('上机时间', readonly=False)
|
||||
machine_tool_code = fields.Char('机台号', readonly=False)
|
||||
cutting_tool_code = fields.Char('刀位号', readonly=False)
|
||||
idle_time = fields.Char('闲置时长', readonly=False)
|
||||
alarm_value = fields.Char('报警值', readonly=False)
|
||||
used_value = fields.Char('已使用值', readonly=False)
|
||||
alarm_type = fields.Char('报警类型', readonly=False)
|
||||
alarm_time = fields.Char('报警时间', readonly=False)
|
||||
dispose_user = fields.Char('处理人', readonly=False)
|
||||
dispose_time = fields.Char('处理时间', readonly=False)
|
||||
dispose_func = fields.Char('处理方法/措施', readonly=False)
|
||||
remark = fields.Char('备注', readonly=False)
|
||||
|
||||
@api.onchange('functional_cutting_tool_id')
|
||||
def onchange_functional_cutting_tool_id(self):
|
||||
@@ -197,16 +197,16 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
image = fields.Binary('图片', readonly=True)
|
||||
|
||||
# 功能刀具实时分布
|
||||
tool_stock_num = fields.Char(string='刀具房库存数量', readonly=True)
|
||||
side_shelf_num = fields.Char(string='线边货架货架数量', readonly=True)
|
||||
on_tool_stock_num = fields.Char(string='机内刀库库存数量', readonly=True)
|
||||
tool_stock_total = fields.Char(string='合计', readonly=True)
|
||||
return_reuse_num_re = fields.Char(string='归还再用数量(精)', readonly=True)
|
||||
return_reuse_num_co = fields.Char(string='归还再用数量(粗)', readonly=True)
|
||||
return_processing_num = fields.Char(string='归还需磨削数量', readonly=True)
|
||||
return_total = fields.Char(string='合计', readonly=True)
|
||||
total = fields.Char(string='总计', readonly=True)
|
||||
remark = fields.Char(string='备注/说明', readonly=True)
|
||||
tool_stock_num = fields.Char(string='刀具房库存数量', readonly=False)
|
||||
side_shelf_num = fields.Char(string='线边货架货架数量', readonly=False)
|
||||
on_tool_stock_num = fields.Char(string='机内刀库库存数量', readonly=False)
|
||||
tool_stock_total = fields.Char(string='合计', readonly=False)
|
||||
return_reuse_num_re = fields.Char(string='归还再用数量(精)', readonly=False)
|
||||
return_reuse_num_co = fields.Char(string='归还再用数量(粗)', readonly=False)
|
||||
return_processing_num = fields.Char(string='归还需磨削数量', readonly=False)
|
||||
return_total = fields.Char(string='合计', readonly=False)
|
||||
total = fields.Char(string='总计', readonly=False)
|
||||
remark = fields.Char(string='备注/说明', readonly=False)
|
||||
|
||||
|
||||
class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
||||
@@ -263,25 +263,25 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
||||
image = fields.Binary('图片', readonly=True)
|
||||
|
||||
# 功能刀具出入库记录 特有字段
|
||||
thickness = fields.Selection([('1', '粗'), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=True)
|
||||
max_life_span = fields.Char(string='最大寿命值', readonly=True)
|
||||
alarm_value = fields.Char(string='报警值', readonly=True)
|
||||
used_value = fields.Char(string='已使用值', readonly=True)
|
||||
current_state = fields.Char(string='当前状态', readonly=True)
|
||||
current_store_area = fields.Char(string='当前库区', readonly=True)
|
||||
current_store_place = fields.Char(string='当前库位', readonly=True)
|
||||
number = fields.Integer(string='数量', readonly=True)
|
||||
reason_application = fields.Char(string='申请原因', readonly=True)
|
||||
applicant = fields.Char(string='申请人', readonly=True)
|
||||
return_staff = fields.Char(string='归还人', readonly=True)
|
||||
return_time = fields.Date(string='归还入库时间', readonly=True)
|
||||
tool_state = fields.Char(string="刀具状态", readonly=True)
|
||||
tool_install_staff = fields.Char(string='装刀人', readonly=True)
|
||||
tool_install_time = fields.Datetime(string='装刀时间', readonly=True)
|
||||
receive_equipment = fields.Char(string='领用机台', readonly=True)
|
||||
receive_staff = fields.Char(string='领用人', readonly=True)
|
||||
receive_time = fields.Char(string='领用出库时间', readonly=True)
|
||||
remark = fields.Text(string='备注/说明', readonly=True)
|
||||
thickness = fields.Selection([('1', '粗'), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=False)
|
||||
max_life_span = fields.Char(string='最大寿命值', readonly=False)
|
||||
alarm_value = fields.Char(string='报警值', readonly=False)
|
||||
used_value = fields.Char(string='已使用值', readonly=False)
|
||||
current_state = fields.Char(string='当前状态', readonly=False)
|
||||
current_store_area = fields.Char(string='当前库区', readonly=False)
|
||||
current_store_place = fields.Char(string='当前库位', readonly=False)
|
||||
number = fields.Integer(string='数量', readonly=False)
|
||||
reason_application = fields.Char(string='申请原因', readonly=False)
|
||||
applicant = fields.Char(string='申请人', readonly=False)
|
||||
return_staff = fields.Char(string='归还人', readonly=False)
|
||||
return_time = fields.Date(string='归还入库时间', readonly=False)
|
||||
tool_state = fields.Char(string="刀具状态", readonly=False)
|
||||
tool_install_staff = fields.Char(string='装刀人', readonly=False)
|
||||
tool_install_time = fields.Datetime(string='装刀时间', readonly=False)
|
||||
receive_equipment = fields.Char(string='领用机台', readonly=False)
|
||||
receive_staff = fields.Char(string='领用人', readonly=False)
|
||||
receive_time = fields.Char(string='领用出库时间', readonly=False)
|
||||
remark = fields.Text(string='备注/说明', readonly=False)
|
||||
|
||||
|
||||
class MachineTableToolChangingApply(models.Model):
|
||||
@@ -294,37 +294,43 @@ class MachineTableToolChangingApply(models.Model):
|
||||
# string='换刀需求信息',
|
||||
# attrs="{'invisible': 1}")
|
||||
|
||||
name = fields.Char(string='CNC机床', readonly="True")
|
||||
# todo 机床类型和刀位号 为 Many2one
|
||||
machine_table_type = fields.Char(string='机床类型', readonly="True")
|
||||
name = fields.Many2one('sf.machine_tool', string='CNC机床', readonly=False)
|
||||
machine_table_type_id = fields.Many2one('sf.machine_tool.category', string='机床类型', readonly=False)
|
||||
machine_tool_code = fields.Char(string='机台号', attrs="{'invisible': 1}")
|
||||
cutter_spacing_code = fields.Char(string='刀位号', readonly="True")
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly="True")
|
||||
functional_tool_name = fields.Char(string='功能刀具名称', readonly="True")
|
||||
# todo 功能刀具类型为 Many2one
|
||||
functional_tool_type = fields.Char(string='功能刀具类型', readonly="True")
|
||||
diameter = fields.Char(string='直径', readonly="True")
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly="True")
|
||||
hilt_name = fields.Char(string='刀柄名称', readonly="True")
|
||||
hilt_code = fields.Char(string='刀柄编号', readonly="True")
|
||||
max_lifetime_value = fields.Char(string='最大寿命值', readonly="True")
|
||||
alarm_value = fields.Char(string='报警值', readonly="True")
|
||||
used_value = fields.Char(string='已使用值', readonly="True")
|
||||
functional_tool_status = fields.Selection([('正常', '正常'), ('异常', '异常')], string='功能刀具状态', default='正常', readonly="True")
|
||||
cutter_spacing_code = fields.Char(string='刀位号', readonly=False)
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True, compute='_compute_functional_tool_name_id')
|
||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=False)
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model',string='功能刀具类型', readonly=True, compute='_compute_functional_tool_name_id')
|
||||
diameter = fields.Char(string='直径', readonly=False)
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=False)
|
||||
hilt_name = fields.Char(string='刀柄名称', readonly=False)
|
||||
hilt_code = fields.Char(string='刀柄编号', readonly=False)
|
||||
max_lifetime_value = fields.Char(string='最大寿命值', readonly=False)
|
||||
alarm_value = fields.Char(string='报警值', readonly=False)
|
||||
used_value = fields.Char(string='已使用值', readonly=False)
|
||||
functional_tool_status = fields.Selection([('正常', '正常'), ('异常', '异常')], string='功能刀具状态', default='正常', readonly=False)
|
||||
|
||||
replacement_tool_code = fields.Char(string='待换刀具编码', readonly="True")
|
||||
replacement_tool_name = fields.Char(string='待换刀具名称', readonly="True")
|
||||
replacement_tool_type = fields.Char(string='待换刀具类型', readonly="True")
|
||||
replacement_tool_code = fields.Char(string='待换刀具编码', readonly=True)
|
||||
replacement_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='待换刀具名称', readonly=True)
|
||||
replacement_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='待换刀具类型', readonly=True)
|
||||
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')],
|
||||
string='粗/中/精', readonly="True")
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly="True")
|
||||
applicant = fields.Char(string='申请人', readonly="True")
|
||||
used_tool_time = fields.Datetime(string='用刀时间', readonly="True")
|
||||
reason_for_applying = fields.Char(string='申请原因', readonly="True")
|
||||
remark = fields.Char(string='备注说明', readonly="True")
|
||||
string='粗/中/精', readonly=True)
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly=True)
|
||||
applicant = fields.Char(string='申请人', readonly=True)
|
||||
used_tool_time = fields.Datetime(string='用刀时间', readonly=True)
|
||||
reason_for_applying = fields.Char(string='申请原因', readonly=True)
|
||||
remark = fields.Char(string='备注说明', readonly=False)
|
||||
|
||||
status = fields.Selection([('0', '未操作'), ('1', '已换刀申请'), ('2', '已转移')], string='操作状态', default='0')
|
||||
|
||||
@api.depends('functional_tool_name_id')
|
||||
def _compute_functional_tool_name_id(self):
|
||||
for record in self:
|
||||
if record:
|
||||
record.functional_tool_code = record.functional_tool_name_id.code
|
||||
record.functional_tool_type_id = record.functional_tool_name_id.mrs_cutting_tool_type_id.id
|
||||
|
||||
|
||||
@api.onchange('functional_tool_status')
|
||||
def automation_apply_for_tool_change(self):
|
||||
"""
|
||||
@@ -335,10 +341,10 @@ class MachineTableToolChangingApply(models.Model):
|
||||
# todo 自动换刀申请条件需补充完善
|
||||
if(self.functional_tool_status == '异常'):
|
||||
self.env['sf.machine.table.tool.changing.apply'].search([
|
||||
('name', '=', self.name)]).write({
|
||||
('name', '=', self.name.id)]).write({
|
||||
'replacement_tool_code': self.functional_tool_code,
|
||||
'replacement_tool_name': self.functional_tool_name,
|
||||
'replacement_tool_type': self.functional_tool_type,
|
||||
'replacement_tool_name_id': self.functional_tool_name_id.id,
|
||||
'replacement_tool_type_id': self.functional_tool_type_id.id,
|
||||
'replacement_tool_coarse_middle_thin': self.coarse_middle_thin,
|
||||
'new_former': '0',
|
||||
'applicant': '自动申请',
|
||||
@@ -351,8 +357,8 @@ class MachineTableToolChangingApply(models.Model):
|
||||
# 新建组装任务
|
||||
self.env['sf.functional.tool.assembly'].create({
|
||||
'functional_tool_code': self.functional_tool_code,
|
||||
'name': self.functional_tool_name,
|
||||
'functional_tool_type': self.functional_tool_type,
|
||||
'name': self.functional_tool_name_id,
|
||||
'functional_tool_type_id': self.functional_tool_type_id.id,
|
||||
'functional_tool_diameter': self.diameter,
|
||||
'loading_task_source': '1',
|
||||
'applicant': '自动申请',
|
||||
@@ -384,11 +390,16 @@ class MachineTableToolChangingApply(models.Model):
|
||||
换刀申请撤回按键
|
||||
:return:
|
||||
"""
|
||||
# 撤回功能刀具组装创建的任务
|
||||
self.env['sf.functional.tool.assembly'].search(
|
||||
[('functional_tool_code', '=', self.replacement_tool_code),
|
||||
('loading_task_source', '=', '机台换刀')]).unlink()
|
||||
|
||||
# 撤回数据更新
|
||||
self.env['sf.machine.table.tool.changing.apply'].search([('name', '=', self.name)]).write({
|
||||
self.env['sf.machine.table.tool.changing.apply'].search([('name', '=', self.name.id)]).write({
|
||||
'replacement_tool_code': None,
|
||||
'replacement_tool_name': None,
|
||||
'replacement_tool_type': None,
|
||||
'replacement_tool_name_id': None,
|
||||
'replacement_tool_type_id': None,
|
||||
'replacement_tool_coarse_middle_thin': None,
|
||||
'new_former': None,
|
||||
'applicant': None,
|
||||
@@ -398,10 +409,6 @@ class MachineTableToolChangingApply(models.Model):
|
||||
'status': '0'
|
||||
})
|
||||
|
||||
# 撤回功能刀具组装创建新任务
|
||||
self.env['sf.functional.tool.assembly'].search(
|
||||
[('functional_tool_code', '=', self.functional_tool_code)]).unlink()
|
||||
|
||||
|
||||
def revocation_2(self):
|
||||
"""
|
||||
@@ -409,7 +416,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
:return:
|
||||
"""
|
||||
self.env['sf.machine.table.tool.changing.apply'].search(
|
||||
[('name', '=', self.name)]).write({
|
||||
[('name', '=', self.name.id)]).write({
|
||||
'status': '0'
|
||||
})
|
||||
|
||||
@@ -418,38 +425,38 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
_name = 'sf.cam.work.order.program.knife.plan'
|
||||
_description = 'CAM工单程序用刀计划'
|
||||
|
||||
name = fields.Char(string='工单任务编号', readonly=True)
|
||||
cam_procedure_code = fields.Char(string='CAM程序编号', readonly=True)
|
||||
cam_cutter_spacing_code = fields.Char(string='CAM刀位号', readonly=True)
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
||||
functional_tool_name = fields.Char(string='功能刀具名称', readonly=True)
|
||||
functional_tool_type = fields.Char(string='功能刀具类型', readonly=True)
|
||||
machine_table_name = fields.Char(string='机床名称', readonly=True)
|
||||
machine_tool_cutter_spacing_code = fields.Char(string='机床刀位号', readonly=True)
|
||||
diameter = fields.Char(string='直径(程式)', readonly=True)
|
||||
tool_loading_length = fields.Char(string='装刀长', readonly=True)
|
||||
clearance_length = fields.Char(string='避空长', readonly=True)
|
||||
tool_included_angle = fields.Char(string='刀尖角(R角)', readonly=True)
|
||||
L_D = fields.Char(string='L/D', readonly=True)
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=True)
|
||||
required_cutting_time = fields.Char(string='需要切割时间', readonly=True)
|
||||
whether_standard_tool = fields.Boolean(string='是否标准刀', readonly=True)
|
||||
need_knife_time = fields.Datetime(string='需要用刀时间', readonly=True)
|
||||
name = fields.Char(string='工单任务编号', readonly=False)
|
||||
cam_procedure_code = fields.Char(string='CAM程序编号', readonly=False)
|
||||
cam_cutter_spacing_code = fields.Char(string='CAM刀位号', readonly=False)
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=False)
|
||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=False)
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=False)
|
||||
machine_table_name_id = fields.Many2one('sf.machine_tool', string='机床名称', readonly=False)
|
||||
machine_tool_cutter_spacing_code = fields.Char(string='机床刀位号', readonly=False)
|
||||
diameter = fields.Char(string='直径(程式)', readonly=False)
|
||||
tool_loading_length = fields.Char(string='装刀长', readonly=False)
|
||||
clearance_length = fields.Char(string='避空长', readonly=False)
|
||||
tool_included_angle = fields.Char(string='刀尖角(R角)', readonly=False)
|
||||
L_D = fields.Char(string='L/D', readonly=False)
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=False)
|
||||
required_cutting_time = fields.Char(string='需要切割时间', readonly=False)
|
||||
whether_standard_tool = fields.Boolean(string='是否标准刀', readonly=False)
|
||||
need_knife_time = fields.Datetime(string='需要用刀时间', readonly=False)
|
||||
plan_execute_status = fields.Selection([('0', '待下发'), ('1', '执行中'), ('2', '已完成')],
|
||||
string='计划执行状态', default='0', readonly=True)
|
||||
applicant = fields.Char(string='申请人', readonly=True)
|
||||
reason_for_applying = fields.Char(string='申请原因', readonly=True)
|
||||
remark = fields.Char(string='备注说明', readonly=True)
|
||||
string='计划执行状态', default='0', readonly=False)
|
||||
applicant = fields.Char(string='申请人', readonly=False)
|
||||
reason_for_applying = fields.Char(string='申请原因', readonly=False)
|
||||
remark = fields.Char(string='备注说明', readonly=False)
|
||||
|
||||
def automation_apply_for_tooling(self):
|
||||
def apply_for_tooling(self):
|
||||
"""
|
||||
自动申请装刀
|
||||
申请装刀
|
||||
:return:
|
||||
"""
|
||||
self.env['sf.functional.tool.assembly'].create({
|
||||
'functional_tool_code': self.functional_tool_code,
|
||||
'name': self.functional_tool_name,
|
||||
'functional_tool_type': self.functional_tool_type,
|
||||
'name': self.functional_tool_name_id.id,
|
||||
'functional_tool_type_id': self.functional_tool_type_id.id,
|
||||
'functional_tool_diameter': self.diameter,
|
||||
'functional_tool_length': self.tool_loading_length,
|
||||
'loading_task_source': '0',
|
||||
@@ -458,7 +465,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
'applicant': self.applicant,
|
||||
'reason_for_applying': self.reason_for_applying,
|
||||
'use_tool_time': self.need_knife_time,
|
||||
'machine_tool_name': self.machine_table_name,
|
||||
'machine_tool_name_id': self.machine_table_name_id.id,
|
||||
'machine_tool_code': self.cam_procedure_code,
|
||||
'cutter_spacing_code': self.cam_cutter_spacing_code
|
||||
})
|
||||
@@ -467,13 +474,15 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
self.env['sf.cam.work.order.program.knife.plan'].search(
|
||||
[('functional_tool_code', '=', self.functional_tool_code)]).write({'plan_execute_status': '1'})
|
||||
|
||||
|
||||
def revocation(self):
|
||||
"""
|
||||
撤回装刀申请
|
||||
:return:
|
||||
"""
|
||||
self.env['sf.functional.tool.assembly'].search(
|
||||
[('functional_tool_code', '=', self.functional_tool_code)]).unlink()
|
||||
[('functional_tool_code', '=', self.functional_tool_code),
|
||||
('loading_task_source', '=', 'CAM装刀')]).unlink()
|
||||
|
||||
# 将计划执行状态改为待执行
|
||||
self.env['sf.cam.work.order.program.knife.plan'].search(
|
||||
@@ -489,25 +498,25 @@ class FunctionalToolAssembly(models.Model):
|
||||
_order = 'use_tool_time asc'
|
||||
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
||||
name = fields.Char(string='功能刀具名称', readonly=True)
|
||||
functional_tool_type = fields.Char(string='功能刀具类型', readonly=True)
|
||||
name = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=True)
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
||||
functional_tool_diameter = fields.Char(string='功能刀具直径', readonly=True)
|
||||
functional_tool_length = fields.Char(string='功能刀具伸出长', readonly=True)
|
||||
functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=True)
|
||||
functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
||||
|
||||
tool_name = fields.Char(string='刀具名称', readonly=True)
|
||||
tool_brand = fields.Char(string='品牌', readonly=True)
|
||||
tool_type = fields.Char(string='型号', readonly=True)
|
||||
knife_handle_name = fields.Char(string='刀柄名称', readonly=True)
|
||||
knife_handle_brand = fields.Char(string='品牌', readonly=True)
|
||||
knife_handle_type = fields.Char(string='型号', readonly=True)
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=True)
|
||||
tool_loading_length = fields.Char(string='装刀长', readonly=True)
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly=True)
|
||||
reference_length = fields.Char(string='参考伸出长', readonly=True)
|
||||
cut_time = fields.Char(string='已切削时间', readonly=True)
|
||||
cut_length = fields.Char(string='已切削长度', readonly=True)
|
||||
cut_number = fields.Char(string='已切削次数', readonly=True)
|
||||
tool_name = fields.Char(string='刀具名称', readonly=False)
|
||||
tool_brand = fields.Char(string='品牌', readonly=False)
|
||||
tool_type = fields.Char(string='型号', readonly=False)
|
||||
knife_handle_name = fields.Char(string='刀柄名称', readonly=False)
|
||||
knife_handle_brand = fields.Char(string='品牌', readonly=False)
|
||||
knife_handle_type = fields.Char(string='型号', readonly=False)
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=False)
|
||||
tool_loading_length = fields.Char(string='装刀长', readonly=False)
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly=False)
|
||||
reference_length = fields.Char(string='参考伸出长', readonly=False)
|
||||
cut_time = fields.Char(string='已切削时间', readonly=False)
|
||||
cut_length = fields.Char(string='已切削长度', readonly=False)
|
||||
cut_number = fields.Char(string='已切削次数', readonly=False)
|
||||
|
||||
loading_task_source = fields.Selection([('0', 'CAM装刀'), ('1', '机台换刀')], string='装刀任务来源', readonly=True)
|
||||
applicant = fields.Char(string='申请人', readonly=True)
|
||||
@@ -515,8 +524,8 @@ class FunctionalToolAssembly(models.Model):
|
||||
apply_time = fields.Datetime(string='申请时间', default=fields.Datetime.now(), readonly=True)
|
||||
assemble_status = fields.Selection([('0', '待组装'), ('1', '已组装'), ('2', '已出库')],string='组装状态', default='0', readonly=True)
|
||||
use_tool_time = fields.Datetime(string='用刀时间', readonly=True)
|
||||
production_line_name = fields.Char(string='产线名称', readonly=True)
|
||||
machine_tool_name = fields.Char(string='机床名称', readonly=True)
|
||||
production_line_name = fields.Char(string='产线名称', readonly=False)
|
||||
machine_tool_name_id = fields.Many2one('sf.machine_tool', string='机床名称', readonly=True)
|
||||
machine_tool_code = fields.Char(string='机台号', readonly=True)
|
||||
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
|
||||
|
||||
@@ -526,7 +535,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
receive_time = fields.Datetime(string='领用出库时间', readonly=True)
|
||||
remark = fields.Char(string='备注说明', readonly=True)
|
||||
|
||||
check_box_1 = fields.Boolean(string='复选框', default=False, readonly=True)
|
||||
check_box_1 = fields.Boolean(string='复选框', default=False, readonly=False)
|
||||
|
||||
@api.onchange('assemble_status')
|
||||
def check_box(self):
|
||||
@@ -540,7 +549,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
:return:
|
||||
"""
|
||||
self.env['sf.functional.tool.assembly'].search([
|
||||
('machine_tool_name', '=', self.machine_tool_name),
|
||||
('machine_tool_name_id', '=', self.machine_tool_name_id.id),
|
||||
('cutter_spacing_code', '=', self.cutter_spacing_code)
|
||||
]).write({
|
||||
'tool_name': None,
|
||||
@@ -575,8 +584,8 @@ class FunctionalToolAssembly(models.Model):
|
||||
for val in vals:
|
||||
self.env['sf.delivery.of.cargo.from.storage'].create({
|
||||
'functional_tool_code': val.functional_tool_code,
|
||||
'name': val.name,
|
||||
'functional_tool_type': val.functional_tool_type,
|
||||
'name': val.name.id,
|
||||
'functional_tool_type_id': val.functional_tool_type_id.id,
|
||||
'production_line_name': val.production_line_name,
|
||||
'machine_tool_code': val.machine_tool_code,
|
||||
'receive_person': val.receive_person,
|
||||
@@ -585,8 +594,8 @@ class FunctionalToolAssembly(models.Model):
|
||||
else:
|
||||
self.env['sf.delivery.of.cargo.from.storage'].create({
|
||||
'functional_tool_code': self.functional_tool_code,
|
||||
'name': self.name,
|
||||
'functional_tool_type': self.functional_tool_type,
|
||||
'name': self.name.id,
|
||||
'functional_tool_type_id': self.functional_tool_type_id.id,
|
||||
'production_line_name': self.production_line_name,
|
||||
'machine_tool_code': self.machine_tool_code,
|
||||
'receive_person': self.receive_person,
|
||||
|
||||
Reference in New Issue
Block a user