入库模块:物料类别隔离硬性校验(写拦截,读放宽)
This commit is contained in:
@ -115,6 +115,12 @@ class ProductInboundService:
|
||||
if not material.is_enabled:
|
||||
raise ValueError(f"物料【{material.name}】已停用,无法办理新入库。")
|
||||
|
||||
# ============================================================
|
||||
# 物料类别隔离校验:成品入库必须为"成品"类目
|
||||
# ============================================================
|
||||
if not material.category or "成品" not in material.category:
|
||||
raise ValueError(f"物料【{material.name}】类别为【{material.category or '空'}】,非成品,无法办理成品入库!")
|
||||
|
||||
ProductInboundService._check_unique(
|
||||
serial_number=data.get('serial_number')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user