fix: capture and persist target object names for delete, outbound, and borrow operations in audit logs

This commit is contained in:
DXC
2026-03-20 15:47:13 +08:00
parent b08bbba718
commit 032479fe38
15 changed files with 54 additions and 21 deletions

View File

@ -252,9 +252,12 @@ class ProductInboundService:
try:
stock = StockProduct.query.get(stock_id)
if stock:
# 提前获取物料名称用于审计日志
material_name = stock.material_name
db.session.delete(stock)
db.session.commit()
return True
return material_name
return None
except Exception as e:
db.session.rollback()
raise e