[IMP] stock_location_orderpoint: Add an index on stock move level

If the database contains billion of stock moves, deletion of an orderpoint can
take a great amount of time. Add an index to avoid that.
This commit is contained in:
Denis Roussel
2023-06-05 13:55:19 +02:00
committed by Michael Tietz
parent f8ac1bb387
commit 24856621b1

View File

@@ -12,7 +12,7 @@ class StockMove(models.Model):
_inherit = "stock.move"
location_orderpoint_id = fields.Many2one(
"stock.location.orderpoint", "Stock location orderpoint"
"stock.location.orderpoint", "Stock location orderpoint", index=True
)
@ormcache("self", "product")