修复出库时候找不到名称等问题
This commit is contained in:
@ -30,7 +30,8 @@ class ProductInboundService:
|
||||
|
||||
exists = query.first()
|
||||
if exists:
|
||||
occupied_name = exists.material.name if (hasattr(exists, 'material') and exists.material) else "未知物料"
|
||||
# [修改] material -> base
|
||||
occupied_name = exists.base.name if (hasattr(exists, 'base') and exists.base) else "未知物料"
|
||||
raise ValueError(f"序列号【{serial_number}】已存在!被成品 [{occupied_name}] 占用,请核查。")
|
||||
|
||||
# ============================================================
|
||||
@ -318,6 +319,7 @@ class ProductInboundService:
|
||||
|
||||
items = []
|
||||
for item in current_items:
|
||||
# [注意] 因为Model层已经修改了 to_dict 内部的 material -> base,所以这里直接调 to_dict 即可
|
||||
d = item.to_dict()
|
||||
|
||||
# 格式化日期
|
||||
|
||||
Reference in New Issue
Block a user