中控新增是否完成字段,该接口根据该字段对cnc加工工单进行完成操作

This commit is contained in:
jinling.yang
2024-06-17 16:06:49 +08:00
parent c2b7abaae1
commit 8ade3b43c4

View File

@@ -8,7 +8,7 @@ from odoo.http import request
class Manufacturing_Connect(http.Controller): 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="*") cors="*")
def get_Work_Info(self, **kw): def get_Work_Info(self, **kw):
""" """
@@ -216,7 +216,8 @@ class Manufacturing_Connect(http.Controller):
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单未开始'} res = {'Succeed': False, 'ErrorCode': 202, 'Error': '该工单未开始'}
return json.JSONEncoder().encode(res) return json.JSONEncoder().encode(res)
# workorder.write({'date_finished': datetime.now()}) # workorder.write({'date_finished': datetime.now()})
workorder.button_finish() if ret['IsComplete'] is True:
workorder.button_finish()
# workorder.process_state = '待解除装夹' # workorder.process_state = '待解除装夹'
# workorder.sudo().production_id.process_state = '待解除装夹' # workorder.sudo().production_id.process_state = '待解除装夹'