This commit is contained in:
jinling.yang
2024-02-02 15:52:19 +08:00

View File

@@ -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