From 7ddaace1ad06e70ed7c7ee2abf0962be5f5cff5a Mon Sep 17 00:00:00 2001 From: gqh Date: Wed, 22 Feb 2023 17:14:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8F=B7=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E4=B8=AD=E6=96=87=EF=BC=88=E6=89=93=E5=8D=B0=E6=9D=A1=E5=BD=A2?= =?UTF-8?q?=E7=A0=81=E4=B8=8D=E8=83=BD=E5=B8=A6=E4=B8=AD=E6=96=87=E5=90=A6?= =?UTF-8?q?=E5=88=99=E4=BC=9A=E6=8A=A5=E9=94=99=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_bf_connect/__manifest__.py | 4 ++-- sf_bf_connect/models/__init__.py | 2 +- sf_bf_connect/models/process_status.py | 2 +- sf_manufacturing/models/mrp_production.py | 8 ++++++-- sf_manufacturing/views/tray_view.xml | 3 +-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sf_bf_connect/__manifest__.py b/sf_bf_connect/__manifest__.py index bcec62fa..af572074 100644 --- a/sf_bf_connect/__manifest__.py +++ b/sf_bf_connect/__manifest__.py @@ -13,8 +13,8 @@ 'depends': ['sf_base', 'sf_sale', 'sf_dlm'], 'data': [ 'views/res_partner_view.xml', - 'views/view.xml', - 'report/bill_report.xml', + # 'views/view.xml', + # 'report/bill_report.xml', ], 'demo': [ ], diff --git a/sf_bf_connect/models/__init__.py b/sf_bf_connect/models/__init__.py index 21f9d732..43a269e9 100644 --- a/sf_bf_connect/models/__init__.py +++ b/sf_bf_connect/models/__init__.py @@ -1,5 +1,5 @@ from . import http from . import models from . import process_status -from . import jd_eclp +# from . import jd_eclp diff --git a/sf_bf_connect/models/process_status.py b/sf_bf_connect/models/process_status.py index 34acc2b6..e5f33a4d 100644 --- a/sf_bf_connect/models/process_status.py +++ b/sf_bf_connect/models/process_status.py @@ -115,7 +115,7 @@ class FinishStatusChange(models.Model): # default_code = fields.Char(string='内部编码') - def button_validate(self): + def button_validate1(self): # Clean-up the context key at validation to avoid forcing the creation of immediate # transfers. ctx = dict(self.env.context) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 0e388d20..b6e7f3e5 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +import re + from odoo import api, fields, models, _ @@ -57,11 +59,12 @@ class MrpProduction(models.Model): def action_generate_serial(self): self.ensure_one() + iot_code = self.env['stock.lot']._get_next_serial(self.company_id, self.product_id) or self.env['ir.sequence'].next_by_code('stock.lot.serial') + iot_code_name = re.sub('[\u4e00-\u9fa5]', "", iot_code) self.lot_producing_id = self.env['stock.lot'].create({ 'product_id': self.product_id.id, 'company_id': self.company_id.id, - 'name': self.env['stock.lot']._get_next_serial(self.company_id, self.product_id) or self.env[ - 'ir.sequence'].next_by_code('stock.lot.serial'), + 'name': iot_code_name, }) if self.move_finished_ids.filtered(lambda m: m.product_id == self.product_id).move_line_ids: self.move_finished_ids.filtered( @@ -235,6 +238,7 @@ class MrpProduction(models.Model): current_sequence += 1 if work.name == '获取CNC加工程序': work.button_start() + #work.button_finish() work.fetchCNC() #创建工单并进行排序 diff --git a/sf_manufacturing/views/tray_view.xml b/sf_manufacturing/views/tray_view.xml index 869b9843..07068211 100644 --- a/sf_manufacturing/views/tray_view.xml +++ b/sf_manufacturing/views/tray_view.xml @@ -15,8 +15,7 @@ attrs='{"invisible": [("production_id","=",False)]}'/> -
+