优化质量:添加加工质检
This commit is contained in:
1
sf_quality/controller/__init__.py
Normal file
1
sf_quality/controller/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import workorder
|
||||
28
sf_quality/controller/workorder.py
Normal file
28
sf_quality/controller/workorder.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
import requests
|
||||
import logging
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
from odoo.addons.sf_manufacturing.controllers.controllers import Manufacturing_Connect
|
||||
from odoo.addons.sf_base.commons.common import Common
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SfQualityConnect(Manufacturing_Connect):
|
||||
|
||||
@http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def AGVDownProduct(self, **kw):
|
||||
res = super(SfQualityConnect, self).AGVDownProduct(**kw)
|
||||
res = json.loads(res)
|
||||
if res.get('workorder_ids'):
|
||||
try:
|
||||
_logger.info('已下产线的工单:%s' % res.get('workorder_ids'))
|
||||
for order_id in res['workorder_ids']:
|
||||
request.env['quality.cnc.test'].sudo().create(
|
||||
{'workorder_id': order_id, 'write_uid': False, 'write_date': False})
|
||||
except Exception as e:
|
||||
_logger.info('AGV运送下产线接口:%s' % e)
|
||||
return json.JSONEncoder().encode(res)
|
||||
Reference in New Issue
Block a user