1、质检单通过、失败按钮添加工单为返工时隐藏条件;2、处理夹具入库到夹具房时,夹具查询中夹具可用状态没有变更为可用问题;3、处理后置三元检测选择返工后制造订单状态没有变更为返工的问题
This commit is contained in:
@@ -363,7 +363,8 @@ class MrpProduction(models.Model):
|
|||||||
# if production.state == 'pending_cam':
|
# if production.state == 'pending_cam':
|
||||||
# if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
|
# if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
|
||||||
# production.state = 'done'
|
# production.state = 'done'
|
||||||
if any((wo.test_results == '返工' and wo.state == 'done' and production.programming_state in ['已编程'])
|
if any((wo.test_results == '返工' and wo.state == 'done' and
|
||||||
|
(production.programming_state in ['已编程'] or wo.individuation_page_PTD is True))
|
||||||
or (wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', '已编程'])
|
or (wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', '已编程'])
|
||||||
for wo in production.workorder_ids):
|
for wo in production.workorder_ids):
|
||||||
production.state = 'rework'
|
production.state = 'rework'
|
||||||
|
|||||||
@@ -1283,12 +1283,10 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
'detailed_reason': record.detailed_reason,
|
'detailed_reason': record.detailed_reason,
|
||||||
'processing_panel': record.processing_panel,
|
'processing_panel': record.processing_panel,
|
||||||
'routing_type': record.routing_type,
|
'routing_type': record.routing_type,
|
||||||
'handle_result': '待处理' if record.test_results in ['返工',
|
'handle_result': '待处理' if record.test_results in ['返工', '报废'] or record.is_rework is True else '',
|
||||||
'报废'] or record.is_rework is True else '',
|
|
||||||
'test_results': record.test_results,
|
'test_results': record.test_results,
|
||||||
'test_report': record.detection_report})],
|
'test_report': record.detection_report})],
|
||||||
'is_scrap': True if record.test_results == '报废' else False,
|
'is_scrap': True if record.test_results == '报废' else False
|
||||||
'state': 'rework' if (record.routing_type != 'CNC加工' and record.test_results == '返工') else record.production_id.state
|
|
||||||
})
|
})
|
||||||
if record.routing_type == '解除装夹':
|
if record.routing_type == '解除装夹':
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -49,10 +49,10 @@
|
|||||||
</page>
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//header//button[@name='do_pass'][2]" position="attributes">
|
<xpath expr="//header//button[@name='do_pass'][2]" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': ['|',('quality_state', '!=', 'fail'),('work_state','=', 'done')]}</attribute>
|
<attribute name="attrs">{'invisible': ['|',('quality_state', '!=', 'fail'),('work_state','in', ('done', 'rework'))]}</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//header//button[@name='do_fail'][2]" position="attributes">
|
<xpath expr="//header//button[@name='do_fail'][2]" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': ['|',('quality_state', '!=', 'pass'),('work_state','=', 'done')]}</attribute>
|
<attribute name="attrs">{'invisible': ['|',('quality_state', '!=', 'pass'),('work_state','in', ('done', 'rework'))]}</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -143,6 +143,10 @@ class StockLot(models.Model):
|
|||||||
record.tool_material_status = '报废'
|
record.tool_material_status = '报废'
|
||||||
else:
|
else:
|
||||||
record.tool_material_status = '未入库'
|
record.tool_material_status = '未入库'
|
||||||
|
elif record.product_id.categ_id.name in ['夹具']:
|
||||||
|
if record.quant_ids:
|
||||||
|
if record.quant_ids[-1].location_id.name in ['夹具房']:
|
||||||
|
record.tool_material_status = '可用'
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def name_search(self, name='', args=None, operator='ilike', limit=100):
|
def name_search(self, name='', args=None, operator='ilike', limit=100):
|
||||||
|
|||||||
Reference in New Issue
Block a user