[FIX] stock: enable auto_join for stock_move_line <-> stock_picking

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/odoo#32645

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
Damien Bouvy
2019-04-12 08:41:19 +00:00
parent c42551b5d2
commit 19aa7c403a
+1 -1
View File
@@ -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',