From 8e806225d05ca131bf3fcf8f6cb2aee0715739d3 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 1 Feb 2024 17:07:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD=E5=88=80?= =?UTF-8?q?=E5=85=B7=E7=BB=84=E8=A3=85=E6=97=B6=E6=89=AB=E6=8F=8F=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E5=88=80=E5=85=B7=E7=89=A9=E6=96=99=E6=97=B6=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E7=89=A9=E6=96=99=E6=98=AF=E5=90=A6=E5=B7=B2=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=92=8C=E6=98=AF=E5=90=A6=E5=B7=B2=E7=BB=8F=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/wizard/wizard.py | 4 ++++ 1 file changed, 4 insertions(+) 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