Accept Merge Request #1131: (feature/修复多面加工产线状态 -> develop)
Merge Request: 修复多面加工产线状态 Created By: @杨金灵 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @杨金灵 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1131?initial=true
This commit is contained in:
@@ -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='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/GetWoInfo', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def get_Work_Info(self, **kw):
|
def get_Work_Info(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -102,7 +102,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('get_ShiftPlan error:%s' % e)
|
logging.info('get_ShiftPlan error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/QcCheck', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/QcCheck', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def get_qcCheck(self, **kw):
|
def get_qcCheck(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -143,7 +143,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('get_qcCheck error:%s' % e)
|
logging.info('get_qcCheck error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/FeedBackStart', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/FeedBackStart', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def button_Work_START(self, **kw):
|
def button_Work_START(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -191,7 +191,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('button_Work_START error:%s' % e)
|
logging.info('button_Work_START error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/FeedBackEnd', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/FeedBackEnd', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def button_Work_End(self, **kw):
|
def button_Work_End(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -299,7 +299,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('PartQualityInspect error:%s' % e)
|
logging.info('PartQualityInspect error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/CMMProgDolod', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/CMMProgDolod', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def CMMProgDolod(self, **kw):
|
def CMMProgDolod(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -339,7 +339,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('CMMProgDolod error:%s' % e)
|
logging.info('CMMProgDolod error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/NCProgDolod', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/NCProgDolod', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def NCProgDolod(self, **kw):
|
def NCProgDolod(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -380,7 +380,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('NCProgDolod error:%s' % e)
|
logging.info('NCProgDolod error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/LocationChange', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/LocationChange', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def LocationChange(self, **kw):
|
def LocationChange(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -438,7 +438,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('LocationChange error:%s' % e)
|
logging.info('LocationChange error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVToProduct(self, **kw):
|
def AGVToProduct(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -471,10 +471,10 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
workorder = request.env['mrp.workorder'].sudo().search(domain, order='id asc')
|
workorder = request.env['mrp.workorder'].sudo().search(domain, order='id asc')
|
||||||
if workorder:
|
if workorder:
|
||||||
for order in workorder:
|
for order in workorder:
|
||||||
if order.production_id.production_line_state == '待上产线':
|
if order.production_line_state == '待上产线':
|
||||||
logging.info(
|
logging.info(
|
||||||
'制造订单产线状态:%s' % order.production_id.production_line_state)
|
'制造订单产线状态:%s' % order.production_line_state)
|
||||||
order.production_id.write({'production_line_state': '已上产线'})
|
order.write({'production_line_state': '已上产线'})
|
||||||
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
|
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
|
||||||
[
|
[
|
||||||
('rfid_code', '=', rfid_code), ('type', '=', '上产线'),
|
('rfid_code', '=', rfid_code), ('type', '=', '上产线'),
|
||||||
@@ -493,7 +493,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('AGVToProduct error:%s' % e)
|
logging.info('AGVToProduct error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVDownProduct(self, **kw):
|
def AGVDownProduct(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -528,10 +528,10 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
workorder = request.env['mrp.workorder'].sudo().search(domain, order='id asc')
|
workorder = request.env['mrp.workorder'].sudo().search(domain, order='id asc')
|
||||||
if workorder:
|
if workorder:
|
||||||
for order in workorder:
|
for order in workorder:
|
||||||
if order.production_id.production_line_state == '已上产线':
|
if order.production_line_state == '已上产线':
|
||||||
logging.info(
|
logging.info(
|
||||||
'制造订单产线状态:%s' % order.production_id.production_line_state)
|
'制造订单产线状态:%s' % order.production_line_state)
|
||||||
order.production_id.write({'production_line_state': '已下产线'})
|
order.write({'production_line_state': '已下产线'})
|
||||||
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
|
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
|
||||||
[
|
[
|
||||||
('rfid_code', '=', rfid_code), ('type', '=', '下产线'),
|
('rfid_code', '=', rfid_code), ('type', '=', '下产线'),
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ class MrpProduction(models.Model):
|
|||||||
glb_file = fields.Binary("glb模型文件")
|
glb_file = fields.Binary("glb模型文件")
|
||||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', tracking=True)
|
production_line_id = fields.Many2one('sf.production.line', string='生产线', tracking=True)
|
||||||
plan_start_processing_time = fields.Datetime('计划开始加工时间')
|
plan_start_processing_time = fields.Datetime('计划开始加工时间')
|
||||||
production_line_state = fields.Selection(
|
# production_line_state = fields.Selection(
|
||||||
[('待上产线', '待上产线'), ('已上产线', '已上产线'), ('已下产线', '已下产线')],
|
# [('待上产线', '待上产线'), ('已上产线', '已上产线'), ('已下产线', '已下产线')],
|
||||||
string='上/下产线', default='待上产线', tracking=True)
|
# string='上/下产线', default='待上产线', tracking=True)
|
||||||
# 工序状态
|
# 工序状态
|
||||||
# Todo 研究下用法
|
# Todo 研究下用法
|
||||||
process_state = fields.Selection([
|
process_state = fields.Selection([
|
||||||
|
|||||||
@@ -193,8 +193,9 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
|
|
||||||
production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id',
|
production_line_id = fields.Many2one('sf.production.line', related='production_id.production_line_id',
|
||||||
string='生产线', store=True, tracking=True)
|
string='生产线', store=True, tracking=True)
|
||||||
production_line_state = fields.Selection(related='production_id.production_line_state',
|
production_line_state = fields.Selection(
|
||||||
string='上/下产线', store=True, tracking=True)
|
[('待上产线', '待上产线'), ('已上产线', '已上产线'), ('已下产线', '已下产线')],
|
||||||
|
string='上/下产线', default='待上产线', tracking=True)
|
||||||
detection_report = fields.Binary('检测报告', readonly=True)
|
detection_report = fields.Binary('检测报告', readonly=True)
|
||||||
is_remanufacture = fields.Boolean(string='重新生成制造订单', default=False)
|
is_remanufacture = fields.Boolean(string='重新生成制造订单', default=False)
|
||||||
is_fetchcnc = fields.Boolean(string='重新获取NC程序', default=False)
|
is_fetchcnc = fields.Boolean(string='重新获取NC程序', default=False)
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='user_id']" position="after">
|
<xpath expr="//field[@name='user_id']" position="after">
|
||||||
<field name="production_line_id" readonly="1"/>
|
<field name="production_line_id" readonly="1"/>
|
||||||
<field name="production_line_state" readonly="1"/>
|
<!-- <field name="production_line_state" readonly="1"/>-->
|
||||||
<field name="part_number" string="成品的零件图号"/>
|
<field name="part_number" string="成品的零件图号"/>
|
||||||
<field name="part_drawing"/>
|
<field name="part_drawing"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user