Skip to content

Commit

Permalink
[FIX] stock: enable auto_join for stock_move_line <-> stock_picking
Browse files Browse the repository at this point in the history
Avoid pathological SQL queries with extremely long list of ids in a
WHERE clause. The strong relation between these models make an auto_join
a no brainer.

closes odoo#32645

Signed-off-by: Damien Bouvy (dbo) <[email protected]>
  • Loading branch information
bouvyd committed Apr 12, 2019
1 parent c42551b commit 19aa7c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/stock/models/stock_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class StockMoveLine(models.Model):
_order = "result_package_id desc, id"

picking_id = fields.Many2one(
'stock.picking', 'Stock Picking',
'stock.picking', 'Stock Picking', auto_join=True,
help='The stock operation where the packing has been made')
move_id = fields.Many2one(
'stock.move', 'Stock Move',
Expand Down

0 comments on commit 19aa7c4

Please sign in to comment.