Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修复工件配送及权限

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

View File

@@ -304,6 +304,10 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
if not records: if not records:
raise ValidationError('扫描的条形码数据不存在,请重新扫描!') raise ValidationError('扫描的条形码数据不存在,请重新扫描!')
for record_stock_lot in records: 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 tool_material_name = record_stock_lot.product_id.cutting_tool_material_id.name
if tool_material_name == '整体式刀具': if tool_material_name == '整体式刀具':
record.integral_code_id = record_stock_lot.id record.integral_code_id = record_stock_lot.id