forked from erp-dev/erp
fear: stock reverse placeholder
This commit is contained in:
@@ -381,6 +381,30 @@ class StockFlowService:
|
||||
products=products,
|
||||
)
|
||||
|
||||
def offset_stock_change(
|
||||
self,
|
||||
*,
|
||||
source_record_id: int,
|
||||
reason: str,
|
||||
items: List[Dict[str, Any]] | None = None,
|
||||
request_id: str | None = None,
|
||||
extra_meta: Dict[str, Any] | None = None,
|
||||
) -> Tuple[models.StockChangeRecord, List[models.StockChangeDetail], int]:
|
||||
"""
|
||||
创建针对既有库存变动记录的红冲(对冲)占位接口。
|
||||
|
||||
Args:
|
||||
source_record_id: 需要被红冲的库存变动记录 ID。
|
||||
reason: 红冲原因,必须明确记录以便审计。
|
||||
items: 可选的部分红冲明细(支持宽进/严进等结构);为空时表示全量对冲。
|
||||
request_id: 幂等键;同一 request_id 的请求应视为一次操作。
|
||||
extra_meta: 额外的上下文信息(触发来源、操作者备注等)。
|
||||
|
||||
Returns:
|
||||
新生成的反向 `StockChangeRecord`、其明细列表以及明细数量。
|
||||
"""
|
||||
raise NotImplementedError('库存红冲功能尚未实现')
|
||||
|
||||
def _get_and_validate_warehouse(self, warehouse_id: int) -> basic_models.WareHouse:
|
||||
if not warehouse_id:
|
||||
raise ValueError('必须提供仓库ID')
|
||||
|
||||
Reference in New Issue
Block a user