diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py index da76de13..b20ba2b0 100644 --- a/sf_tool_management/models/base.py +++ b/sf_tool_management/models/base.py @@ -116,34 +116,34 @@ class MachineTableToolChangingApply(models.Model): # string='换刀需求信息', # attrs="{'invisible': 1}") - name = fields.Char(string='CNC机床') + name = fields.Char(string='CNC机床', readonly="True") # todo 机床类型和刀位号 为 Many2one - machine_table_type = fields.Char(string='机床类型') + machine_table_type = fields.Char(string='机床类型', readonly="True") machine_tool_code = fields.Char(string='机台号', attrs="{'invisible': 1}") - cutter_spacing_code = fields.Char(string='刀位号') - functional_tool_code = fields.Char(string='功能刀具编码') - functional_tool_name = fields.Char(string='功能刀具名称') + 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='功能刀具类型') - diameter = fields.Char(string='直径') - coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精') - hilt_name = fields.Char(string='刀柄名称') - hilt_code = fields.Char(string='刀柄编号') - max_lifetime_value = fields.Char(string='最大寿命值') - alarm_value = fields.Char(string='报警值') - used_value = fields.Char(string='已使用值') - functional_tool_status = fields.Selection([('正常', '正常'), ('异常', '异常')], string='功能刀具状态', default='正常') + 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") - replacement_tool_code = fields.Char(string='待换刀具编码') - replacement_tool_name = fields.Char(string='待换刀具名称') - replacement_tool_type = fields.Char(string='待换刀具类型') + 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_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], - string='粗/中/精') - new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧') - applicant = fields.Char(string='申请人') - used_tool_time = fields.Datetime(string='用刀时间') - reason_for_applying = fields.Char(string='申请原因') - remark = fields.Char(string='备注说明') + 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") status = fields.Selection([('0', '未操作'), ('1', '已换刀申请'), ('2', '已转移')], string='操作状态', default='0') @@ -240,27 +240,28 @@ class CAMWorkOrderProgramKnifePlan(models.Model): _name = 'sf.cam.work.order.program.knife.plan' _description = 'CAM工单程序用刀计划' - name = fields.Char(string='工单任务编号') - cam_procedure_code = fields.Char(string='CAM程序编号') - cam_cutter_spacing_code = fields.Char(string='CAM刀位号') - functional_tool_code = fields.Char(string='功能刀具编码') - functional_tool_name = fields.Char(string='功能刀具名称') - functional_tool_type = fields.Char(string='功能刀具类型') - machine_table_name = fields.Char(string='机床名称') - machine_tool_cutter_spacing_code = fields.Char(string='机床刀位号') - diameter = fields.Char(string='直径(程式)') - tool_loading_length = fields.Char(string='装刀长') - clearance_length = fields.Char(string='避空长') - tool_included_angle = fields.Char(string='刀尖角(R角)') - L_D = fields.Char(string='L/D') - coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精') - required_cutting_time = fields.Char(string='需要切割时间') - whether_standard_tool = fields.Boolean(string='是否标准刀') - need_knife_time = fields.Datetime(string='需要用刀时间') - plan_execute_status = fields.Selection([('0', '待下发'), ('1', '执行中'), ('2', '已完成')], string='计划执行状态', default='0') - applicant = fields.Char(string='申请人') - reason_for_applying = fields.Char(string='申请原因') - remark = fields.Char(string='备注说明') + 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) + 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) def automation_apply_for_tooling(self): """ @@ -309,44 +310,45 @@ class FunctionalToolAssembly(models.Model): _description = '功能刀具组装' _order = 'use_tool_time asc' - functional_tool_code = fields.Char(string='功能刀具编码') - name = fields.Char(string='功能刀具名称') - functional_tool_type = fields.Char(string='功能刀具类型') - functional_tool_diameter = fields.Char(string='功能刀具直径') - functional_tool_length = fields.Char(string='功能刀具伸出长') - functional_tool_cutting_type = fields.Char(string='功能刀具切削类型') + functional_tool_code = fields.Char(string='功能刀具编码', readonly=True) + name = fields.Char(string='功能刀具名称', readonly=True) + functional_tool_type = fields.Char(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) - tool_name = fields.Char(string='刀具名称') - tool_brand = fields.Char(string='品牌') - tool_type = fields.Char(string='型号') - knife_handle_name = fields.Char(string='刀柄名称') - knife_handle_brand = fields.Char(string='品牌') - knife_handle_type = fields.Char(string='型号') - coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精') - tool_loading_length = fields.Char(string='装刀长') - new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧') - reference_length = fields.Char(string='参考伸出长') - cut_time = fields.Char(string='已切削时间') - cut_length = fields.Char(string='已切削长度') - cut_number = fields.Char(string='已切削次数') + 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) - loading_task_source = fields.Selection([('0', 'CAM装刀'), ('1', '机台换刀')], string='装刀任务来源') - applicant = fields.Char(string='申请人') - reason_for_applying = fields.Char(string='申请原因') - apply_time = fields.Datetime(string='申请时间', default=fields.Datetime.now()) - assemble_status = fields.Selection([('0', '待组装'), ('1', '已组装'), ('2', '已出库')],string='组装状态', default='0') - use_tool_time = fields.Datetime(string='用刀时间') - production_line_name = fields.Char(string='产线名称') - machine_tool_name = fields.Char(string='机床名称') - machine_tool_code = fields.Char(string='机台号') - cutter_spacing_code = fields.Char(string='刀位号') - tool_loading_person = fields.Char(string='装刀人') - tool_loading_time = fields.Datetime(string='装刀时间') - receive_person = fields.Char(string='领用人') - receive_time = fields.Datetime(string='领用出库时间') - remark = fields.Char(string='备注说明') + loading_task_source = fields.Selection([('0', 'CAM装刀'), ('1', '机台换刀')], string='装刀任务来源', readonly=True) + applicant = fields.Char(string='申请人', readonly=True) + reason_for_applying = fields.Char(string='申请原因', readonly=True) + 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) + machine_tool_code = fields.Char(string='机台号', readonly=True) + cutter_spacing_code = fields.Char(string='刀位号', readonly=True) - check_box_1 = fields.Boolean(string='复选框', default=False) + tool_loading_person = fields.Char(string='装刀人', readonly=True) + tool_loading_time = fields.Datetime(string='装刀时间', readonly=True) + receive_person = fields.Char(string='领用人', readonly=True) + receive_time = fields.Datetime(string='领用出库时间', readonly=True) + remark = fields.Char(string='备注说明', readonly=True) + + check_box_1 = fields.Boolean(string='复选框', default=False, readonly=True) @api.onchange('assemble_status') def check_box(self): diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml index 58ec04ef..00d72f7a 100644 --- a/sf_tool_management/views/tool_base_views.xml +++ b/sf_tool_management/views/tool_base_views.xml @@ -215,64 +215,105 @@ - - - - - - - - - - - -