From 8d414d9b8b28c43818c7f43dc5dead518741f121 Mon Sep 17 00:00:00 2001 From: Quentin Groulard Date: Thu, 30 Oct 2025 14:59:57 +0100 Subject: [PATCH] [IMP] contract: Add index on account.move old_contract_id This field is often searched which may be slow on DB with a lot of account moves. --- contract/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract/models/account_move.py b/contract/models/account_move.py index 29ec3f0ce5..a20c75c9ae 100644 --- a/contract/models/account_move.py +++ b/contract/models/account_move.py @@ -10,4 +10,4 @@ class AccountMove(models.Model): _inherit = "account.move" # We keep this field for migration purpose - old_contract_id = fields.Many2one("contract.contract") + old_contract_id = fields.Many2one("contract.contract", index=True)