[FIX] account_purchase_stock_report_non_billed: consider just done moves

TT51626
pull/1248/head
David 2024-11-07 11:39:53 +01:00
parent 60f418c859
commit 66c14aa350
1 changed files with 2 additions and 1 deletions

View File

@ -38,7 +38,8 @@ class StockMove(models.Model):
date_end = self.env.context.get("moves_date_end") date_end = self.env.context.get("moves_date_end")
if date_start and date_end: if date_start and date_end:
moves = moves.filtered( moves = moves.filtered(
lambda ml: ml.date_done >= date_start and ml.date_done <= date_end lambda ml: ml.state == "done"
and (ml.date_done >= date_start and ml.date_done <= date_end)
) )
total_qty = moves.get_total_devolution_moves() total_qty = moves.get_total_devolution_moves()
if qty_invoiced != total_qty: if qty_invoiced != total_qty: