feat: Add new inventory and POS components, including a script to reproduce a POS checkout sale price bug.
This commit is contained in:
@@ -209,16 +209,19 @@ class ShowcaseManager:
|
||||
reservation.order_item = order_item
|
||||
reservation.save()
|
||||
|
||||
# Теперь создаём продажу с правильной ценой из OrderItem
|
||||
SaleProcessor.create_sale_from_reservation(
|
||||
reservation=reservation,
|
||||
order=order
|
||||
)
|
||||
# ВАЖНО: Мы НЕ создаём продажу (Sale) здесь и НЕ меняем статус на 'converted_to_sale'.
|
||||
# Это сделает сигнал create_sale_on_order_completion автоматически.
|
||||
# Таким образом обеспечивается единая точка создания продаж для всех типов товаров.
|
||||
|
||||
# Обновляем статус резерва
|
||||
reservation.status = 'converted_to_sale'
|
||||
reservation.converted_at = timezone.now()
|
||||
reservation.save()
|
||||
# SaleProcessor.create_sale_from_reservation(
|
||||
# reservation=reservation,
|
||||
# order=order
|
||||
# )
|
||||
|
||||
# Статус резерва остается 'reserved', чтобы сигнал его увидел
|
||||
# reservation.status = 'converted_to_sale'
|
||||
# reservation.converted_at = timezone.now()
|
||||
# reservation.save()
|
||||
|
||||
sold_count += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user