提交
This commit is contained in:
1 parent
33c038b8d9
commit
54b27a3f0e
253 files changed
+30060
-14298
No files matched your search
@@ -427,6 +427,13 @@ def delete_inventory(
|
||||
) -> None:
|
||||
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
|
||||
row = _get_inventory(db, tenant_no, id, user)
|
||||
|
||||
if row.status == "已完成":
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail="已完成的记录不能删除",
|
||||
)
|
||||
|
||||
assert_row_deletable_by_creator(row, user_info_from_context(user))
|
||||
row.del_flag = 1
|
||||
row.update_by = user.id
|
||||
|
||||
@@ -296,6 +296,13 @@ def delete_plan(
|
||||
) -> None:
|
||||
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
|
||||
plan = _get_plan(db, tenant_no, id, user)
|
||||
|
||||
if plan.execution_status in ("已入库", "已出库"):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail="已完成的计划不能删除",
|
||||
)
|
||||
|
||||
assert_row_deletable_by_creator(plan, user_info_from_context(user))
|
||||
plan.del_flag = 1
|
||||
plan.update_by = user.id
|
||||
|
||||
Reference in new issue
Block a user