# Added to track total sold for each productfor item in order.orderitem_set.all():product = item.productproduct.total_sold += item.quantityproduct.items_in_stock -= item.quantityproduct.save()
# Added to track total sold for each productfor item in order.orderitem_set.all():product = item.productproduct.total_sold += item.quantityproduct.items_in_stock -= item.quantityproduct.save()
def decrease_inventory_on_sale(sender, order=None, **kwargs):"""Track inventory and total sold."""# Added to track total sold for each productfor item in order.orderitem_set.all():product = item.productproduct.total_sold += item.quantityif config_value('PRODUCT','TRACK_INVENTORY'):product.items_in_stock -= item.quantityproduct.save()
To view this discussion on the web visit https://groups.google.com/d/msg/satchmo-users/-/Rr5PuOr3ipYJ.--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To post to this group, send email to satchm...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.