Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化

This commit is contained in:
mgw
2025-01-15 13:36:34 +08:00
4 changed files with 10 additions and 7 deletions

View File

@@ -363,7 +363,8 @@ class MrpProduction(models.Model):
# if production.state == 'pending_cam':
# if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
# 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 ['编程中', '已编程'])
for wo in production.workorder_ids):
production.state = 'rework'

View File

@@ -1283,12 +1283,10 @@ class ResMrpWorkOrder(models.Model):
'detailed_reason': record.detailed_reason,
'processing_panel': record.processing_panel,
'routing_type': record.routing_type,
'handle_result': '待处理' if record.test_results in ['返工',
'报废'] or record.is_rework is True else '',
'handle_result': '待处理' if record.test_results in ['返工', '报废'] or record.is_rework is True else '',
'test_results': record.test_results,
'test_report': record.detection_report})],
'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
'is_scrap': True if record.test_results == '报废' else False
})
if record.routing_type == '解除装夹':
'''

View File

@@ -49,10 +49,10 @@
</page>
</xpath>
<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 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>
</field>
</record>

View File

@@ -143,6 +143,10 @@ class StockLot(models.Model):
record.tool_material_status = '报废'
else:
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
def name_search(self, name='', args=None, operator='ilike', limit=100):