1、优化工单状态;2、添加功能刀具位置字段自动计算方法触发条件

This commit is contained in:
yuxianghui
2024-07-28 16:05:09 +08:00
parent 89bd9533d7
commit f77a1f6167
3 changed files with 33 additions and 10 deletions

View File

@@ -53,7 +53,8 @@ class FunctionalCuttingToolEntity(models.Model):
safe_inventory_id = fields.Many2one('sf.real.time.distribution.of.functional.tools',
string='功能刀具安全库存', readonly=True)
@api.depends('barcode_id.quant_ids', 'functional_tool_status', 'current_shelf_location_id')
@api.depends('barcode_id.quant_ids', 'barcode_id.quant_ids.location_id', 'functional_tool_status',
'current_shelf_location_id')
def _compute_current_location_id(self):
for record in self:
if record.functional_tool_status == '已拆除':

View File

@@ -106,9 +106,9 @@ class CNCprocessing(models.Model):
'handle_result': '待处理'
})
# 修改当前面装夹预调工单的 is_rework 为 True
work_ids = production_id.workorder_ids.filtered(
lambda a: a.routing_type == '装夹预调' and a.processing_panel == key and not a.is_rework)
work_ids.write({'is_rework': True})
# work_ids = production_id.workorder_ids.filtered(
# lambda a: a.routing_type == '装夹预调' and a.processing_panel == key and not a.is_rework)
# work_ids.write({'is_rework': True})
# 对缺刀信息进行处理
for key in data2:
if data2.get(key):