When a user completes an order, the inventory gets deducted twice:
(1) As soon as payment is made, the IPN view
payment.modules.paypal.views.ipn records the payment, causing the
satchmo_store.shop.signals.order_success signal to be sent, causing
to deduct the sold items from the inventory.
(2) When the user clicks "Return to <site>" on Paypal, the
payment.modules.paypal.views.success view again deducts the sold
items from the inventory.
This means that the inventory will decrease twice as fast as the items in it are selling.
On a related note, why is the logic that clears the cart in the
success view and not the
ipn view? What if a user never clicks the
"Return to <site>" link on Paypal? Clearly his cart should still be
cleared after his payment goes through.