[FIX] stock_picking_report_valued_sale_mrp: non existing backorder_id in stock.move

It was a related field in v13, but now it's only on the picking, so
let's access to it in the code.

TT50285
This commit is contained in:
Pedro M. Baeza
2024-07-24 08:13:20 +02:00
parent 05885bd82a
commit 482c616762

View File

@@ -22,7 +22,10 @@ class StockMove(models.Model):
sale_line.move_ids.filtered(
lambda x: x.product_id == self.product_id
and not x.origin_returned_move_id
and (x.state != "cancel" or (x.state == "cancel" and x.backorder_id))
and (
x.state != "cancel"
or (x.state == "cancel" and x.picking_id.backorder_id)
)
).mapped("product_uom_qty")
)
return component_demand / sale_line.product_uom_qty