Skip to content

Commit

Permalink
[FIX] stock: inefficient traceability domain
Browse files Browse the repository at this point in the history
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 <dgreis@sapo.pt>
  • Loading branch information
xmo-odoo and dreispt committed Mar 18, 2019
1 parent 6b4a35f commit 208e29f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions addons/stock/models/stock_traceability.py
Expand Up @@ -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([
Expand Down

0 comments on commit 208e29f

Please sign in to comment.