Skip to content
Browse files

[FIX] stock: inefficient traceability domain

PR #31086 converted the not-downstream traceability domain to use a
filter instead as =/!= False on an o2m can lead to memory issues due
to the way they're currently implemented / transformed. This also
converts the downstream versiom just in case and to limit deviations
between the branches.

Co-Authored-By: Daniel Reis <>

closes #31901

Signed-off-by: Xavier Morel (xmo) <>
  • Loading branch information...
xmo-odoo committed Mar 18, 2019
1 parent 04f7c65 commit 1f008a439a3f64801eee88b20b0c3c0606741604
Showing with 1 addition and 2 deletions.
  1. +1 −2 addons/stock/models/
@@ -92,8 +92,7 @@ def get_lines(self, line_id=None, **kw):
('lot_id', '=', context.get('active_id')),
('location_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([

0 comments on commit 1f008a4

Please sign in to comment.
You can’t perform that action at this time.