mirror of
https://github.com/OCA/stock-logistics-reporting.git
synced 2025-02-16 17:13:21 +02:00
[FIX] stock_picking_report_valued_sale_mrp: ignored cancelled order
We want to consider backordered moves even if they're cancelled but not cancelled moves from cancelled orders, that must be filtered. Otherwise, they pullute the amounts computation.
This commit is contained in:
@@ -17,5 +17,12 @@ class StockMove(models.Model):
|
||||
component_demand = sum(
|
||||
sale_line.move_ids.filtered(
|
||||
lambda x: x.product_id == self.product_id and
|
||||
not x.origin_returned_move_id).mapped("product_uom_qty"))
|
||||
not x.origin_returned_move_id and
|
||||
(
|
||||
x.state != "cancel" or (
|
||||
x.state == "cancel" and x.backorder_id
|
||||
)
|
||||
)
|
||||
).mapped("product_uom_qty")
|
||||
)
|
||||
return component_demand / sale_line.product_uom_qty
|
||||
|
||||
Reference in New Issue
Block a user