From a0b7b13c5e6bc9010a576805e5d26c53550ef730 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Sat, 19 Nov 2022 22:52:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8E=B7=E5=BE=97cnc?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_route_workcenter/models/workcenter.py | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sf_route_workcenter/models/workcenter.py b/sf_route_workcenter/models/workcenter.py index bc9a9bf8..6d81fb08 100644 --- a/sf_route_workcenter/models/workcenter.py +++ b/sf_route_workcenter/models/workcenter.py @@ -250,20 +250,20 @@ class MrpWorkOrder(models.Model): # cnc程序获取 def fetchCNC(self): - res = {'model_code': self.product_id.barcode, 'production_no': self.production_id.name, - 'machine_tool_code': self.workcenter_id.machine_tool_id.code, - 'material_code': self.env['mrs.production.materials'].search( - [('id', '=', self.product_id.materials_id.id)]).materials_no, - 'material_type_code': self.env['mrs.materials.model'].search( - [('id', '=', self.product_id.materials_type_id.id)]).materials_no, - 'embryo_long': self.product_id.bom_ids.bom_line_ids.product_id.long, - 'embryo_height': self.product_id.bom_ids.bom_line_ids.product_id.height, - 'embryo_width': self.product_id.bom_ids.bom_line_ids.product_id.width - } + res = [{'model_code': self.product_id.barcode, 'production_no': self.production_id.name, + 'machine_tool_code': self.workcenter_id.machine_tool_id.code, + 'material_code': self.env['mrs.production.materials'].search( + [('id', '=', self.product_id.materials_id.id)]).materials_no, + 'material_type_code': self.env['mrs.materials.model'].search( + [('id', '=', self.product_id.materials_type_id.id)]).materials_no, + 'embryo_long': self.product_id.bom_ids.bom_line_ids.product_id.long, + 'embryo_height': self.product_id.bom_ids.bom_line_ids.product_id.height, + 'embryo_width': self.product_id.bom_ids.bom_line_ids.product_id.width + }] configsettings = self.env['res.config.settings'].get_values() - token = configsettings['token'] - mrs_secret_key = configsettings['mrs_secret_key'] - config_header = Common.get_headers(self, token, mrs_secret_key) + # token = configsettings['token'] + # mrs_secret_key = configsettings['mrs_secret_key'] + config_header = Common.get_headers(self, configsettings['token'], configsettings['mrs_secret_key']) url = '/api/intelligent_programming/create' config_url = configsettings['mrs_url'] + url res_str = json.dumps(res)