From 59aa6b4f10ecfbe613997d8df83bd1c19c5e93a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 24 Apr 2025 11:42:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=AB=E7=A0=81=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_work_reporting_api/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jikimo_work_reporting_api/controllers/main.py b/jikimo_work_reporting_api/controllers/main.py index 2b86840c..7976e7de 100644 --- a/jikimo_work_reporting_api/controllers/main.py +++ b/jikimo_work_reporting_api/controllers/main.py @@ -19,7 +19,7 @@ class MainController(http.Controller): return {'code': 400, 'message': '参数错误'} if not isinstance(maintenance_equipment_id, int) and not isinstance(model_id, str): return {'code': 400, 'message': '参数类型错误'} - maintenance_equipment = request.env['maintenance.equipment'].sudo().browse(int(maintenance_equipment_id)) + maintenance_equipment = request.env['maintenance.equipment'].sudo().search([('id', '=', maintenance_equipment_id)], limit=1) if not maintenance_equipment: return {'code': 400, 'message': '机台不存在,请扫描正确的机台二维码'} product = request.env['product.template'].sudo().search([('model_id', '=', model_id)], limit=1)