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
|
||||
# est recalculé automatiquement
|
||||
if ope.article and ope.article_nb:
|
||||
last_stock = (InventoryArticle.objects
|
||||
.select_related('inventory')
|
||||
.filter(article=ope.article)
|
||||
.order_by('inventory__at')
|
||||
.last())
|
||||
last_stock = (
|
||||
InventoryArticle.objects
|
||||
.select_related('inventory')
|
||||
.filter(article=ope.article)
|
||||
.order_by('inventory__at')
|
||||
.last()
|
||||
)
|
||||
if not last_stock or last_stock.inventory.at < ope.group.at:
|
||||
to_articles_stocks[ope.article] += ope.article_nb
|
||||
|
||||
|
|
Loading…
Reference in a new issue