WIP: Aureplop/kpsul js refactor #501
1 changed files with 7 additions and 5 deletions
|
@ -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 = (
|
||||||
.select_related('inventory')
|
InventoryArticle.objects
|
||||||
.filter(article=ope.article)
|
.select_related('inventory')
|
||||||
.order_by('inventory__at')
|
.filter(article=ope.article)
|
||||||
.last())
|
.order_by('inventory__at')
|
||||||
|
.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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue