From 45b6214ddd7dfa296452b37c038917e02b2fc233 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Fri, 27 Sep 2024 09:33:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_message/__manifest__.py | 1 + sf_message/data/template_data.xml | 40 ++++++++ sf_mrs_connect/controllers/controllers.py | 114 +++++++++++----------- 3 files changed, 98 insertions(+), 57 deletions(-) create mode 100644 sf_message/data/template_data.xml diff --git a/sf_message/__manifest__.py b/sf_message/__manifest__.py index 7139f840..1cc18aaa 100644 --- a/sf_message/__manifest__.py +++ b/sf_message/__manifest__.py @@ -14,6 +14,7 @@ 'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify','stock', 'sf_tool_management', 'sf_manufacturing', 'sf_hr'], 'data': [ 'data/bussiness_node.xml', + 'data/template_data.xml', ], 'test': [ ], diff --git a/sf_message/data/template_data.xml b/sf_message/data/template_data.xml new file mode 100644 index 00000000..5ea6601c --- /dev/null +++ b/sf_message/data/template_data.xml @@ -0,0 +1,40 @@ + + + + + 坯料采购提醒 + + purchase.order + + markdown + normal + ### 坯料采购通知: +单号:采购单[{{name}}]({{request_url}}) +事项:请确认坯料采购单并处理 + + + + 坯料发料提醒 + + stock.picking + + markdown + normal + ### 坯料发料提醒: +单号:产品[{{product_id}}]({{request_url}}) +事项:共{{number}}个生产发料单待确认处理 + + + + 工单已下发通知 + + mrp.workorder + + markdown + normal + ### 工单已下发通知: +单号:产品[{{product_id}}]({{request_url}}) +事项:共{{number}}个工单已下发,请查收知悉 + + + \ No newline at end of file diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py index c5d1cd10..1e1baf70 100644 --- a/sf_mrs_connect/controllers/controllers.py +++ b/sf_mrs_connect/controllers/controllers.py @@ -31,68 +31,68 @@ class Sf_Mrs_Connect(http.Controller): request.env.ref("base.user_admin")).search(domain) if productions: # 拉取所有加工面的程序文件 - for r in ret['processing_panel'].split(','): - program_path_tmp_r = os.path.join('/tmp', ret['folder_name'], 'return', r) - if os.path.exists(program_path_tmp_r): - files_r = os.listdir(program_path_tmp_r) - if files_r: - for file_name in files_r: - file_path = os.path.join(program_path_tmp_r, file_name) - os.remove(file_path) - download_state = request.env['sf.cnc.processing'].with_user( - request.env.ref("base.user_admin")).download_file_tmp( - ret['folder_name'], r) - if download_state is False: - res['status'] = -2 - res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no']) - return json.JSONEncoder().encode(res) + # for r in ret['processing_panel'].split(','): + # program_path_tmp_r = os.path.join('/tmp', ret['folder_name'], 'return', r) + # if os.path.exists(program_path_tmp_r): + # files_r = os.listdir(program_path_tmp_r) + # if files_r: + # for file_name in files_r: + # file_path = os.path.join(program_path_tmp_r, file_name) + # os.remove(file_path) + # download_state = request.env['sf.cnc.processing'].with_user( + # request.env.ref("base.user_admin")).download_file_tmp( + # ret['folder_name'], r) + # if download_state is False: + # res['status'] = -2 + # res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no']) + # return json.JSONEncoder().encode(res) for production in productions: if not production.workorder_ids: production.product_id.model_processing_panel = ret['processing_panel'] production._create_workorder(ret) productions.process_range_time() - else: - for panel in ret['processing_panel'].split(','): - # 查询状态为进行中且工序类型为CNC加工的工单 - cnc_workorder_has = production.workorder_ids.filtered( - lambda ach: ach.routing_type == 'CNC加工' and ach.state not in ['progress', 'done', - 'rework', - 'cancel'] and ach.processing_panel == panel) - if cnc_workorder_has: - if cnc_workorder_has.cnc_ids: - cnc_workorder_has.cmm_ids.sudo().unlink() - cnc_workorder_has.cnc_ids.sudo().unlink() - request.env['sf.cam.work.order.program.knife.plan'].sudo().unlink_cam_plan( - production) - cnc_workorder_has.write( - {'cnc_ids': cnc_workorder_has.cnc_ids.sudo()._json_cnc_processing(panel, ret), - 'cmm_ids': cnc_workorder_has.cmm_ids.sudo()._json_cmm_program(panel, ret)}) - for panel in ret['processing_panel'].split(','): - # 查询状态为进行中且工序类型为CNC加工的工单 - cnc_workorder = productions.workorder_ids.filtered( - lambda ac: ac.routing_type == 'CNC加工' and ac.state not in ['progress', 'done', 'rework' - 'cancel'] and ac.processing_panel == panel) - if cnc_workorder: - # program_path_tmp_panel = os.path.join('C://Users//43484//Desktop//fsdownload//test', - # panel) - program_path_tmp_panel = os.path.join('/tmp', ret['folder_name'], 'return', panel) - logging.info('program_path_tmp_panel:%s' % program_path_tmp_panel) - files_panel = os.listdir(program_path_tmp_panel) - if files_panel: - for file in files_panel: - file_extension = os.path.splitext(file)[1] - logging.info('file_extension:%s' % file_extension) - if file_extension.lower() == '.pdf': - panel_file_path = os.path.join(program_path_tmp_panel, file) - logging.info('panel_file_path:%s' % panel_file_path) - cnc_workorder.write({'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())}) - pre_workorder = productions.workorder_ids.filtered( - lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done', 'rework' - 'cancel'] and ap.processing_panel == panel) - if pre_workorder: - pre_workorder.write( - {'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())}) - productions.write({'programming_state': '已编程', 'work_state': '已编程'}) + # else: + # for panel in ret['processing_panel'].split(','): + # # 查询状态为进行中且工序类型为CNC加工的工单 + # cnc_workorder_has = production.workorder_ids.filtered( + # lambda ach: ach.routing_type == 'CNC加工' and ach.state not in ['progress', 'done', + # 'rework', + # 'cancel'] and ach.processing_panel == panel) + # if cnc_workorder_has: + # if cnc_workorder_has.cnc_ids: + # cnc_workorder_has.cmm_ids.sudo().unlink() + # cnc_workorder_has.cnc_ids.sudo().unlink() + # request.env['sf.cam.work.order.program.knife.plan'].sudo().unlink_cam_plan( + # production) + # cnc_workorder_has.write( + # {'cnc_ids': cnc_workorder_has.cnc_ids.sudo()._json_cnc_processing(panel, ret), + # 'cmm_ids': cnc_workorder_has.cmm_ids.sudo()._json_cmm_program(panel, ret)}) + # for panel in ret['processing_panel'].split(','): + # # 查询状态为进行中且工序类型为CNC加工的工单 + # cnc_workorder = productions.workorder_ids.filtered( + # lambda ac: ac.routing_type == 'CNC加工' and ac.state not in ['progress', 'done', 'rework' + # 'cancel'] and ac.processing_panel == panel) + # if cnc_workorder: + # # program_path_tmp_panel = os.path.join('C://Users//43484//Desktop//fsdownload//test', + # # panel) + # program_path_tmp_panel = os.path.join('/tmp', ret['folder_name'], 'return', panel) + # logging.info('program_path_tmp_panel:%s' % program_path_tmp_panel) + # files_panel = os.listdir(program_path_tmp_panel) + # if files_panel: + # for file in files_panel: + # file_extension = os.path.splitext(file)[1] + # logging.info('file_extension:%s' % file_extension) + # if file_extension.lower() == '.pdf': + # panel_file_path = os.path.join(program_path_tmp_panel, file) + # logging.info('panel_file_path:%s' % panel_file_path) + # cnc_workorder.write({'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())}) + # pre_workorder = productions.workorder_ids.filtered( + # lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done', 'rework' + # 'cancel'] and ap.processing_panel == panel) + # if pre_workorder: + # pre_workorder.write( + # {'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())}) + # productions.write({'programming_state': '已编程', 'work_state': '已编程'}) return json.JSONEncoder().encode(res) else: res = {'status': 0, 'message': '该制造订单暂未开始'} From 01a2771dfb4b318abdef6d326838bc23a6b6a485 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Fri, 27 Sep 2024 09:35:18 +0800 Subject: [PATCH 2/4] =?UTF-8?q?Revert=20"=E6=B6=88=E6=81=AF=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=88=9D=E5=A7=8B=E6=95=B0=E6=8D=AE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 45b6214ddd7dfa296452b37c038917e02b2fc233. --- sf_message/__manifest__.py | 1 - sf_message/data/template_data.xml | 40 -------- sf_mrs_connect/controllers/controllers.py | 114 +++++++++++----------- 3 files changed, 57 insertions(+), 98 deletions(-) delete mode 100644 sf_message/data/template_data.xml diff --git a/sf_message/__manifest__.py b/sf_message/__manifest__.py index 1cc18aaa..7139f840 100644 --- a/sf_message/__manifest__.py +++ b/sf_message/__manifest__.py @@ -14,7 +14,6 @@ 'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify','stock', 'sf_tool_management', 'sf_manufacturing', 'sf_hr'], 'data': [ 'data/bussiness_node.xml', - 'data/template_data.xml', ], 'test': [ ], diff --git a/sf_message/data/template_data.xml b/sf_message/data/template_data.xml deleted file mode 100644 index 5ea6601c..00000000 --- a/sf_message/data/template_data.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - 坯料采购提醒 - - purchase.order - - markdown - normal - ### 坯料采购通知: -单号:采购单[{{name}}]({{request_url}}) -事项:请确认坯料采购单并处理 - - - - 坯料发料提醒 - - stock.picking - - markdown - normal - ### 坯料发料提醒: -单号:产品[{{product_id}}]({{request_url}}) -事项:共{{number}}个生产发料单待确认处理 - - - - 工单已下发通知 - - mrp.workorder - - markdown - normal - ### 工单已下发通知: -单号:产品[{{product_id}}]({{request_url}}) -事项:共{{number}}个工单已下发,请查收知悉 - - - \ No newline at end of file diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py index 1e1baf70..c5d1cd10 100644 --- a/sf_mrs_connect/controllers/controllers.py +++ b/sf_mrs_connect/controllers/controllers.py @@ -31,68 +31,68 @@ class Sf_Mrs_Connect(http.Controller): request.env.ref("base.user_admin")).search(domain) if productions: # 拉取所有加工面的程序文件 - # for r in ret['processing_panel'].split(','): - # program_path_tmp_r = os.path.join('/tmp', ret['folder_name'], 'return', r) - # if os.path.exists(program_path_tmp_r): - # files_r = os.listdir(program_path_tmp_r) - # if files_r: - # for file_name in files_r: - # file_path = os.path.join(program_path_tmp_r, file_name) - # os.remove(file_path) - # download_state = request.env['sf.cnc.processing'].with_user( - # request.env.ref("base.user_admin")).download_file_tmp( - # ret['folder_name'], r) - # if download_state is False: - # res['status'] = -2 - # res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no']) - # return json.JSONEncoder().encode(res) + for r in ret['processing_panel'].split(','): + program_path_tmp_r = os.path.join('/tmp', ret['folder_name'], 'return', r) + if os.path.exists(program_path_tmp_r): + files_r = os.listdir(program_path_tmp_r) + if files_r: + for file_name in files_r: + file_path = os.path.join(program_path_tmp_r, file_name) + os.remove(file_path) + download_state = request.env['sf.cnc.processing'].with_user( + request.env.ref("base.user_admin")).download_file_tmp( + ret['folder_name'], r) + if download_state is False: + res['status'] = -2 + res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no']) + return json.JSONEncoder().encode(res) for production in productions: if not production.workorder_ids: production.product_id.model_processing_panel = ret['processing_panel'] production._create_workorder(ret) productions.process_range_time() - # else: - # for panel in ret['processing_panel'].split(','): - # # 查询状态为进行中且工序类型为CNC加工的工单 - # cnc_workorder_has = production.workorder_ids.filtered( - # lambda ach: ach.routing_type == 'CNC加工' and ach.state not in ['progress', 'done', - # 'rework', - # 'cancel'] and ach.processing_panel == panel) - # if cnc_workorder_has: - # if cnc_workorder_has.cnc_ids: - # cnc_workorder_has.cmm_ids.sudo().unlink() - # cnc_workorder_has.cnc_ids.sudo().unlink() - # request.env['sf.cam.work.order.program.knife.plan'].sudo().unlink_cam_plan( - # production) - # cnc_workorder_has.write( - # {'cnc_ids': cnc_workorder_has.cnc_ids.sudo()._json_cnc_processing(panel, ret), - # 'cmm_ids': cnc_workorder_has.cmm_ids.sudo()._json_cmm_program(panel, ret)}) - # for panel in ret['processing_panel'].split(','): - # # 查询状态为进行中且工序类型为CNC加工的工单 - # cnc_workorder = productions.workorder_ids.filtered( - # lambda ac: ac.routing_type == 'CNC加工' and ac.state not in ['progress', 'done', 'rework' - # 'cancel'] and ac.processing_panel == panel) - # if cnc_workorder: - # # program_path_tmp_panel = os.path.join('C://Users//43484//Desktop//fsdownload//test', - # # panel) - # program_path_tmp_panel = os.path.join('/tmp', ret['folder_name'], 'return', panel) - # logging.info('program_path_tmp_panel:%s' % program_path_tmp_panel) - # files_panel = os.listdir(program_path_tmp_panel) - # if files_panel: - # for file in files_panel: - # file_extension = os.path.splitext(file)[1] - # logging.info('file_extension:%s' % file_extension) - # if file_extension.lower() == '.pdf': - # panel_file_path = os.path.join(program_path_tmp_panel, file) - # logging.info('panel_file_path:%s' % panel_file_path) - # cnc_workorder.write({'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())}) - # pre_workorder = productions.workorder_ids.filtered( - # lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done', 'rework' - # 'cancel'] and ap.processing_panel == panel) - # if pre_workorder: - # pre_workorder.write( - # {'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())}) - # productions.write({'programming_state': '已编程', 'work_state': '已编程'}) + else: + for panel in ret['processing_panel'].split(','): + # 查询状态为进行中且工序类型为CNC加工的工单 + cnc_workorder_has = production.workorder_ids.filtered( + lambda ach: ach.routing_type == 'CNC加工' and ach.state not in ['progress', 'done', + 'rework', + 'cancel'] and ach.processing_panel == panel) + if cnc_workorder_has: + if cnc_workorder_has.cnc_ids: + cnc_workorder_has.cmm_ids.sudo().unlink() + cnc_workorder_has.cnc_ids.sudo().unlink() + request.env['sf.cam.work.order.program.knife.plan'].sudo().unlink_cam_plan( + production) + cnc_workorder_has.write( + {'cnc_ids': cnc_workorder_has.cnc_ids.sudo()._json_cnc_processing(panel, ret), + 'cmm_ids': cnc_workorder_has.cmm_ids.sudo()._json_cmm_program(panel, ret)}) + for panel in ret['processing_panel'].split(','): + # 查询状态为进行中且工序类型为CNC加工的工单 + cnc_workorder = productions.workorder_ids.filtered( + lambda ac: ac.routing_type == 'CNC加工' and ac.state not in ['progress', 'done', 'rework' + 'cancel'] and ac.processing_panel == panel) + if cnc_workorder: + # program_path_tmp_panel = os.path.join('C://Users//43484//Desktop//fsdownload//test', + # panel) + program_path_tmp_panel = os.path.join('/tmp', ret['folder_name'], 'return', panel) + logging.info('program_path_tmp_panel:%s' % program_path_tmp_panel) + files_panel = os.listdir(program_path_tmp_panel) + if files_panel: + for file in files_panel: + file_extension = os.path.splitext(file)[1] + logging.info('file_extension:%s' % file_extension) + if file_extension.lower() == '.pdf': + panel_file_path = os.path.join(program_path_tmp_panel, file) + logging.info('panel_file_path:%s' % panel_file_path) + cnc_workorder.write({'cnc_worksheet': base64.b64encode(open(panel_file_path, 'rb').read())}) + pre_workorder = productions.workorder_ids.filtered( + lambda ap: ap.routing_type == '装夹预调' and ap.state not in ['done', 'rework' + 'cancel'] and ap.processing_panel == panel) + if pre_workorder: + pre_workorder.write( + {'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())}) + productions.write({'programming_state': '已编程', 'work_state': '已编程'}) return json.JSONEncoder().encode(res) else: res = {'status': 0, 'message': '该制造订单暂未开始'} From 7f384c3f56cfd1c3b7707fe69504e1845298809a Mon Sep 17 00:00:00 2001 From: guanhuan Date: Fri, 27 Sep 2024 09:36:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_message/__manifest__.py | 1 + sf_message/data/template_data.xml | 40 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 sf_message/data/template_data.xml diff --git a/sf_message/__manifest__.py b/sf_message/__manifest__.py index 7139f840..1cc18aaa 100644 --- a/sf_message/__manifest__.py +++ b/sf_message/__manifest__.py @@ -14,6 +14,7 @@ 'depends': ['sale', 'purchase', 'sf_plan', 'jikimo_message_notify','stock', 'sf_tool_management', 'sf_manufacturing', 'sf_hr'], 'data': [ 'data/bussiness_node.xml', + 'data/template_data.xml', ], 'test': [ ], diff --git a/sf_message/data/template_data.xml b/sf_message/data/template_data.xml new file mode 100644 index 00000000..5ea6601c --- /dev/null +++ b/sf_message/data/template_data.xml @@ -0,0 +1,40 @@ + + + + + 坯料采购提醒 + + purchase.order + + markdown + normal + ### 坯料采购通知: +单号:采购单[{{name}}]({{request_url}}) +事项:请确认坯料采购单并处理 + + + + 坯料发料提醒 + + stock.picking + + markdown + normal + ### 坯料发料提醒: +单号:产品[{{product_id}}]({{request_url}}) +事项:共{{number}}个生产发料单待确认处理 + + + + 工单已下发通知 + + mrp.workorder + + markdown + normal + ### 工单已下发通知: +单号:产品[{{product_id}}]({{request_url}}) +事项:共{{number}}个工单已下发,请查收知悉 + + + \ No newline at end of file From f8060113d9376c9182c1516ee2c1e2043b944289 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Fri, 27 Sep 2024 10:14:13 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AD=97=E6=AE=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 44 ++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 6329dd9e..7f4dc2b8 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -42,10 +42,10 @@ class ResProductMo(models.Model): product_model_type_id = fields.Many2one('sf.model.type', string='产品模型类型') embryo_model_type_id = fields.Many2one('sf.model.type', string='坯料模型类型') materials_id = fields.Many2one('sf.production.materials', string='材料') - # materials_type_id = fields.Many2one('sf.materials.model', string='材料型号', - # domain="[('materials_id', '=', materials_id)]") - materials_type_id = fields.Many2one(related='cutting_tool_model_id.material_model_id', string='材料型号', + materials_type_id = fields.Many2one('sf.materials.model', string='材料型号', domain="[('materials_id', '=', materials_id)]") + # materials_type_id = fields.Many2one(related='cutting_tool_model_id.material_model_id', string='材料型号', + # domain="[('materials_id', '=', materials_id)]") # cutting_tool_model_id.material_model_id server_product_process_parameters_id = fields.Many2one('sf.production.process.parameter', string='表面工艺参数(服务产品)') @@ -58,10 +58,10 @@ class ResProductMo(models.Model): cutting_tool_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='型号名称') specification_id = fields.Many2one('sf.tool.materials.basic.parameters', string='物料号') - # cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='类型', - # domain="[('cutting_tool_material_id.name', '=', cutting_tool_type)]") - cutting_tool_type_id = fields.Many2one(related='cutting_tool_model_id.cutting_tool_type_id', string='类型', + cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='类型', domain="[('cutting_tool_material_id.name', '=', cutting_tool_type)]") + # cutting_tool_type_id = fields.Many2one(related='cutting_tool_model_id.cutting_tool_type_id', string='类型', + # domain="[('cutting_tool_material_id.name', '=', cutting_tool_type)]") # brand_id = fields.Many2one('sf.machine.brand', '品牌') brand_id = fields.Many2one(related='cutting_tool_model_id.brand_id', string='品牌') # cutting_tool_model_id.brand_id @@ -630,14 +630,14 @@ class ResProductMo(models.Model): cutting_tool_installing_structure = fields.Char(related='specification_id.installing_structure', string='安装结构') # specification_id.installing_structure - # cutting_tool_blade_id = fields.Many2one( - # 'sf.cutting_tool.standard.library', - # domain="[('cutting_tool_type', '=', '刀片')]", - # string='适用刀片型号' # 使用空列表作为默认值 - # ) - cutting_tool_blade_id = fields.Many2one(related='specification_id.blade_id', - domain="[('cutting_tool_type', '=', '刀片')]", - string='适用刀片型号') + cutting_tool_blade_id = fields.Many2one( + 'sf.cutting_tool.standard.library', + domain="[('cutting_tool_type', '=', '刀片')]", + string='适用刀片型号' # 使用空列表作为默认值 + ) + # cutting_tool_blade_id = fields.Many2one(related='specification_id.blade_id', + # domain="[('cutting_tool_type', '=', '刀片')]", + # string='适用刀片型号') # specification_id.blade_id # cutting_tool_tool_shim = fields.Char('适配刀垫型号', size=50) cutting_tool_tool_shim = fields.Char(related='specification_id.tool_shim', @@ -756,14 +756,14 @@ class ResProductMo(models.Model): # string='适用刀柄型号' # ) - # cutting_tool_handle_id = fields.Many2one( - # 'sf.cutting_tool.standard.library', - # domain="[('cutting_tool_type', '=', '刀柄')]", - # string='适用刀柄型号' - # ) - cutting_tool_handle_id = fields.Many2one(related='cutting_tool_model_id.handle_id', - domain="[('cutting_tool_type', '=', '刀柄')]", - string='适用刀柄型号') + cutting_tool_handle_id = fields.Many2one( + 'sf.cutting_tool.standard.library', + domain="[('cutting_tool_type', '=', '刀柄')]", + string='适用刀柄型号' + ) + # cutting_tool_handle_id = fields.Many2one(related='cutting_tool_model_id.handle_id', + # domain="[('cutting_tool_type', '=', '刀柄')]", + # string='适用刀柄型号') # cutting_tool_model_id.handle_id # 注册状态