diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 7b3467b7..95f484ef 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -606,6 +606,8 @@ class ResMrpWorkOrder(models.Model): if self.routing_type == '装夹预调': if not self.material_center_point and self.X_deviation_angle > 0: raise UserError("请对前置三元检测定位参数进行计算定位") + if not self.rfid_code: + raise UserError("请扫RFID码进行绑定") if self.picking_out_id: picking_out = self.env['stock.picking'].search([('id', '=', self.picking_out_id.id)]) if picking_out.workorder_out_id: @@ -869,7 +871,8 @@ class SfWorkOrderBarcodes(models.Model): [('production_id', '=', workorder.production_id.id)]) if workorder_rfid: for item in workorder_rfid: - item.write({'rfid_code': barcode}) + if item.state == "progress": + item.write({'rfid_code': barcode}) class WorkPieceDelivery(models.Model): diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index be0c09ae..ddc2ee6d 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -8,8 +8,8 @@ from odoo.exceptions import ValidationError from odoo.modules import get_resource_path -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index 4a766526..9797178e 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -104,7 +104,7 @@ - +