[FIX] stock_picking_batch_custom: validar collected solo en operaciones detalladas

This commit is contained in:
snt 2026-04-08 18:29:55 +02:00
parent 2237cba034
commit 05a8908007
4 changed files with 63 additions and 27 deletions

View file

@ -43,15 +43,13 @@ class StockPicking(models.Model):
batch_pickings = self.filtered(
lambda picking, batch=batch: picking.batch_id == batch
)
processed_product_ids = (
batch_pickings.move_line_ids.filtered(
lambda line: line.move_id.state not in ("cancel", "done")
processed_move_lines = batch_pickings.move_line_ids.filtered(
lambda line: (
line.move_id.state not in ("cancel", "done")
and line.product_id
and line.quantity
and line.move_id.quantity > 0
)
.mapped("product_id")
.ids
)
if not processed_product_ids:
if not processed_move_lines:
continue
batch._check_all_products_collected(processed_product_ids)
batch._check_all_products_collected(batch_pickings)