Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化制造功能
This commit is contained in:
@@ -84,6 +84,7 @@ class MrsProductionProcessCategory(models.Model):
|
|||||||
class MrsProductionProcess(models.Model):
|
class MrsProductionProcess(models.Model):
|
||||||
_name = 'sf.production.process'
|
_name = 'sf.production.process'
|
||||||
_description = '表面工艺'
|
_description = '表面工艺'
|
||||||
|
order = 'sequence asc'
|
||||||
|
|
||||||
code = fields.Char("编码")
|
code = fields.Char("编码")
|
||||||
name = fields.Char('名称')
|
name = fields.Char('名称')
|
||||||
|
|||||||
@@ -165,7 +165,7 @@
|
|||||||
<field name="model">sf.production.process</field>
|
<field name="model">sf.production.process</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="表面工艺" create="0" edit="0" delete="0">
|
<tree string="表面工艺" create="0" edit="0" delete="0">
|
||||||
<field name="sequence" widget="handle" string="序号" readonly="1"/>
|
<field name="sequence" string="加工顺序" readonly="1"/>
|
||||||
<field name="code"/>
|
<field name="code"/>
|
||||||
<field name="name" string="名称"/>
|
<field name="name" string="名称"/>
|
||||||
<field name="remark"/>
|
<field name="remark"/>
|
||||||
|
|||||||
@@ -477,7 +477,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='none', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVToProduct(self, **kw):
|
def AGVToProduct(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -549,7 +549,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='none', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVDownProduct(self, **kw):
|
def AGVDownProduct(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -668,7 +668,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('AGVDownProduct error:%s' % e)
|
logging.info('AGVDownProduct error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/AgvStationState', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AgvStationState', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVStationState(self, **kw):
|
def AGVStationState(self, **kw):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -664,7 +664,7 @@ class MrpProduction(models.Model):
|
|||||||
# 表面工艺工序
|
# 表面工艺工序
|
||||||
# 模型类型的表面工艺工序模版
|
# 模型类型的表面工艺工序模版
|
||||||
surface_tmpl_ids = model_type_id.surface_technics_routing_tmpl_ids
|
surface_tmpl_ids = model_type_id.surface_technics_routing_tmpl_ids
|
||||||
# 产品选择的表面工艺
|
# 产品选择的表面工艺参数
|
||||||
model_process_parameters_ids = rec.product_id.model_process_parameters_ids
|
model_process_parameters_ids = rec.product_id.model_process_parameters_ids
|
||||||
process_dict = {}
|
process_dict = {}
|
||||||
if model_process_parameters_ids:
|
if model_process_parameters_ids:
|
||||||
@@ -673,7 +673,7 @@ class MrpProduction(models.Model):
|
|||||||
for surface_tmpl_id in surface_tmpl_ids:
|
for surface_tmpl_id in surface_tmpl_ids:
|
||||||
if process_id == surface_tmpl_id.route_workcenter_id.surface_technics_id:
|
if process_id == surface_tmpl_id.route_workcenter_id.surface_technics_id:
|
||||||
surface_tmpl_name = surface_tmpl_id.route_workcenter_id.name
|
surface_tmpl_name = surface_tmpl_id.route_workcenter_id.name
|
||||||
process_dict.update({int(process_id.category_id.code): '%s-%s' % (
|
process_dict.update({int(process_id.sequence): '%s-%s' % (
|
||||||
surface_tmpl_name, process_parameters_id.name)})
|
surface_tmpl_name, process_parameters_id.name)})
|
||||||
process_list = sorted(process_dict.keys())
|
process_list = sorted(process_dict.keys())
|
||||||
for process_num in process_list:
|
for process_num in process_list:
|
||||||
@@ -690,11 +690,10 @@ class MrpProduction(models.Model):
|
|||||||
raise ValidationError('该产品【加工面板】为空!')
|
raise ValidationError('该产品【加工面板】为空!')
|
||||||
else:
|
else:
|
||||||
raise ValidationError('该产品没有选择【模版类型】!')
|
raise ValidationError('该产品没有选择【模版类型】!')
|
||||||
|
logging.info('sequence_list: %s' % sequence_list)
|
||||||
for work in rec.workorder_ids:
|
for work in rec.workorder_ids:
|
||||||
work_name = work.name
|
work_name = work.name
|
||||||
if '-' in work.name:
|
logging.info(work_name)
|
||||||
work_name = work.name.split('-')[0]
|
|
||||||
if sequence_list.get(work_name):
|
if sequence_list.get(work_name):
|
||||||
work.sequence = sequence_list[work_name]
|
work.sequence = sequence_list[work_name]
|
||||||
elif sequence_list.get(work.processing_panel):
|
elif sequence_list.get(work.processing_panel):
|
||||||
@@ -727,8 +726,6 @@ class MrpProduction(models.Model):
|
|||||||
panel_sequence_list.update({tmpl_id.route_workcenter_id.name: sequence_max})
|
panel_sequence_list.update({tmpl_id.route_workcenter_id.name: sequence_max})
|
||||||
for work_id in work_ids:
|
for work_id in work_ids:
|
||||||
work_name = work_id.name
|
work_name = work_id.name
|
||||||
if '-' in work_id.name:
|
|
||||||
work_name = work_id.name.split('-')[0]
|
|
||||||
if panel_sequence_list.get(work_name):
|
if panel_sequence_list.get(work_name):
|
||||||
work_id.sequence = panel_sequence_list[work_name]
|
work_id.sequence = panel_sequence_list[work_name]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user