diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index ef2c654b..d121bae8 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1456,6 +1456,9 @@ class ResMrpWorkOrder(models.Model): # 解绑托盘 def unbind_tray(self): + for item in self: + self.env['stock.lot'].sudo().search([('rfid', '=', item.rfid_code)]).write( + {'tool_material_status': '可用'}) self.production_id.workorder_ids.write({ 'rfid_code': False, 'tray_serial_number': False, @@ -1464,9 +1467,6 @@ class ResMrpWorkOrder(models.Model): 'tray_type_id': False, 'tray_model_id': False, 'is_trayed': False}) - for item in self: - self.env['stock.lot'].sudo().search([('rfid', '=', item.rfid_code)]).write({ - 'tool_material_status': '可用'}) # 将FTP的检测报告文件下载到临时目录 def download_reportfile_tmp(self, workorder, reportpath):