1、解决刀具物料采购时,自动生成序列号重复问题;2、优化刀具物料生成序列号时,自动更新刀具物料查询记录的方法

This commit is contained in:
yuxianghui
2024-03-19 17:20:19 +08:00
parent bb78404772
commit 952e663b31
2 changed files with 2 additions and 2 deletions

View File

@@ -263,7 +263,7 @@ class ProductionLot(models.Model):
if not last_serial:
return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, 1)
else:
return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, int(last_serial.name[-3:]) + 1)
return "%s-%s%03d" % (product.cutting_tool_model_id.code[:-12], now, int(last_serial.name[-3:]) + 2)
else:
raise ValidationError('该刀具物料产品的型号字段为空,请补充完整!!!')