WIP: Aureplop/kpsul js refactor #501

Draft
delobell wants to merge 215 commits from aureplop/kpsul_js_refactor into master
Showing only changes of commit b544d6c5b3 - Show all commits

View file

@ -1332,11 +1332,13 @@ def kpsul_cancel_operations(request):
# Note : si InventoryArticle est maj par .save(), stock_error # Note : si InventoryArticle est maj par .save(), stock_error
# est recalculé automatiquement # est recalculé automatiquement
if ope.article and ope.article_nb: if ope.article and ope.article_nb:
last_stock = (InventoryArticle.objects last_stock = (
InventoryArticle.objects
.select_related('inventory') .select_related('inventory')
.filter(article=ope.article) .filter(article=ope.article)
.order_by('inventory__at') .order_by('inventory__at')
.last()) .last()
)
if not last_stock or last_stock.inventory.at < ope.group.at: if not last_stock or last_stock.inventory.at < ope.group.at:
to_articles_stocks[ope.article] += ope.article_nb to_articles_stocks[ope.article] += ope.article_nb