From 8ade3b43c4d14bacc8dc86dd54caa4eae02c7e2d Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Mon, 17 Jun 2024 16:06:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E6=8E=A7=E6=96=B0=E5=A2=9E=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=AE=8C=E6=88=90=E5=AD=97=E6=AE=B5,=E8=AF=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A0=B9=E6=8D=AE=E8=AF=A5=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=AF=B9cnc=E5=8A=A0=E5=B7=A5=E5=B7=A5=E5=8D=95=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=AE=8C=E6=88=90=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/controllers/controllers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py index ddbf4048..61bc83ea 100644 --- a/sf_manufacturing/controllers/controllers.py +++ b/sf_manufacturing/controllers/controllers.py @@ -8,7 +8,7 @@ from odoo.http import request class Manufacturing_Connect(http.Controller): - @http.route('/AutoDeviceApi/GetWoInfo', type='json', auth='none', methods=['GET', 'POST'], csrf=False, + @http.route('/AutoDeviceApi/GetWoInfo', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False, cors="*") def get_Work_Info(self, **kw): """ @@ -216,7 +216,8 @@ class Manufacturing_Connect(http.Controller): res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单未开始'} return json.JSONEncoder().encode(res) # workorder.write({'date_finished': datetime.now()}) - workorder.button_finish() + if ret['IsComplete'] is True: + workorder.button_finish() # workorder.process_state = '待解除装夹' # workorder.sudo().production_id.process_state = '待解除装夹'