From e9afce298d735877af745a2e90120ba7bd252c38 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Tue, 29 Aug 2023 17:40:16 +0800 Subject: [PATCH] =?UTF-8?q?SF=E7=82=B9=E5=87=BB=E5=90=8E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?cnc=E7=A8=8B=E5=BA=8F=E6=8C=89=E9=92=AE=EF=BC=8Ccloud=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=9A=84=E7=BC=96=E7=A8=8B=E5=8D=95=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E6=9C=AA=E6=98=BE=E7=A4=BABug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 42 ++++++++---------------- sf_sale/views/quick_easy_order_view.xml | 1 + 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index b81e6d1e..232ae241 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -135,7 +135,6 @@ class ResMrpWorkOrder(models.Model): self.functional_fixture_code = self.functional_fixture_id.code self.functional_fixture_type_id = self.functional_fixture_id.type_id.id - def get_no_data(self, production_id): process_parameter_workorder = self.search( [('surface_technics_parameters_id', '!=', False), ('production_id', '=', production_id)]) @@ -338,19 +337,19 @@ class ResMrpWorkOrder(models.Model): # tray.unclamp() # self.tray_id = False - # return { - # 'name': _('New Maintenance Request'), - # 'view_mode': 'form', - # 'res_model': 'maintenance.request', - # 'res_id':self.id, - # 'type': 'ir.actions.act_window', - # 'context': { - # 'default_company_id': self.company_id.id, - # 'default_production_id': self.id, - # }, - # 'domain': [('production_id', '=', self.id)], - # 'target':'new' - # } + # return { + # 'name': _('New Maintenance Request'), + # 'view_mode': 'form', + # 'res_model': 'maintenance.request', + # 'res_id':self.id, + # 'type': 'ir.actions.act_window', + # 'context': { + # 'default_company_id': self.company_id.id, + # 'default_production_id': self.id, + # }, + # 'domain': [('production_id', '=', self.id)], + # 'target':'new' + # } def recreateManufacturingOrWorkerOrder(self): """ @@ -400,20 +399,6 @@ class ResMrpWorkOrder(models.Model): try: cnc = self.env['mrp.workorder'].search( [('routing_type', '=', 'CNC加工'), ('production_id', '=', self.production_id.id)], limit=1) - logging.info('fetchCNC-cnc:%s' % cnc) - # if cnc.product_id.upload_model_file: - # logging.info('fetchCNC-upload_model_file:%s' % cnc.product_id.upload_model_file) - # attachments = cnc.product_id.upload_model_file[0] - # logging.info('fetchCNC-attachment1:%s' % attachments) - # logging.info('fetchCNC-attachment1:%s' % cnc.product_id.upload_model_file[0]) - # logging.info('fetchCNC-attachment2:%s' % cnc.product_id.upload_model_file[0].datas) - # logging.info('fetchCNC-attachment:%s' % attachments.datas) - # base64_data = base64.b64encode(attachments.datas) - # logging.info('fetchCNC-attachment1:%s' % attachments) - # base64_datas = base64_data.decode('utf-8') - # model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest() - # logging.info('fetchCNC-model_code:%s' % model_code) - logging.info('fetchCNC-model_code1:%s' % cnc.product_id.model_code) res = {'model_code': '' if not cnc.product_id.model_code else cnc.product_id.model_code, 'production_no': self.production_id.name, 'machine_tool_code': cnc.workcenter_id.machine_tool_id.code, @@ -427,6 +412,7 @@ class ResMrpWorkOrder(models.Model): 'embryo_height': cnc.product_id.bom_ids.bom_line_ids.product_id.height, 'embryo_width': cnc.product_id.bom_ids.bom_line_ids.product_id.width, 'order_no': cnc.production_id.origin, + 'model_order_no': cnc.product_id.default_code.rsplit('-', 1)[0], 'user': self.env.user.name, 'model_file': '' if not cnc.product_id.model_file else base64.b64encode( cnc.product_id.model_file).decode('utf-8') diff --git a/sf_sale/views/quick_easy_order_view.xml b/sf_sale/views/quick_easy_order_view.xml index cf8a2c9f..c140dad7 100644 --- a/sf_sale/views/quick_easy_order_view.xml +++ b/sf_sale/views/quick_easy_order_view.xml @@ -6,6 +6,7 @@ quick.easy.order FP-%(year)s-%(month)s%(day)s- 4 + # ---------- 快速订单 ------------