diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py index e6f39655..9f4e075e 100644 --- a/sf_tool_management/wizard/wizard.py +++ b/sf_tool_management/wizard/wizard.py @@ -304,6 +304,10 @@ class FunctionalToolAssemblyOrder(models.TransientModel): if not records: raise ValidationError('扫描的条形码数据不存在,请重新扫描!') for record_stock_lot in records: + if record_stock_lot.quant_ids[-1].location_id.name == '刀具组装位置': + raise ValidationError('该刀具物料已使用,请重新选择!!!') + elif record_stock_lot.quant_ids[-1].location_id.name not in '刀具房': + raise ValidationError('该刀具物料未入库,请重新选择!!!') tool_material_name = record_stock_lot.product_id.cutting_tool_material_id.name if tool_material_name == '整体式刀具': record.integral_code_id = record_stock_lot.id