fix: remove total_price from product inbound service

Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
dxc
2026-03-02 12:12:57 +08:00
parent 8264867b1c
commit 2f140e112f

View File

@ -171,7 +171,6 @@ class ProductInboundService:
production_time_range=time_range,
raw_material_cost=raw_cost,
manual_cost=unit_total_cost,
total_price=total_price,
quality_status=data.get('quality_status', '合格'),
product_photo=json.dumps(photo_list),
quality_report_link=json.dumps(quality_list),
@ -231,10 +230,6 @@ class ProductInboundService:
stock.stock_quantity = float(stock.stock_quantity) + diff
stock.available_quantity = float(stock.available_quantity) + diff
# 计算总成本
if 'unit_total_cost' in data or 'in_quantity' in data:
qty = float(data.get('in_quantity', stock.in_quantity or 1))
stock.total_price = float(stock.manual_cost or 0) * qty
if 'production_start_time' in data or 'production_end_time' in data:
old_range = stock.production_time_range or " ~ "