From 84affe37a17735fbd5d92ee6e20cb4782772bb23 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Thu, 14 Feb 2019 00:56:49 +0000 Subject: [PATCH] [FIX] stock: traceability report: performance Replaced an inefficient domain by a filtered expression. closes odoo/odoo#31086 --- addons/stock/models/stock_traceability.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/stock/models/stock_traceability.py b/addons/stock/models/stock_traceability.py index 97e7d3cd0f9..27c42aab30d 100644 --- a/addons/stock/models/stock_traceability.py +++ b/addons/stock/models/stock_traceability.py @@ -108,8 +108,7 @@ class MrpStockReport(models.TransientModel): ('lot_id', '=', context.get('active_id')), ('location_dest_id.usage', '!=', 'internal'), ('state', '=', 'done'), - ('move_id.returned_move_ids', '=', False), - ]) + ]).filtered(lambda s: not s.move_id.returned_move_ids) res += self._lines(line_id, model_id=model_id, model='stock.move.line', level=level, parent_quant=parent_quant, stream=stream, obj_ids=move_ids) quant_ids = self.env['stock.quant'].search([