Add indexes on account payment models

The fields where the indexes are added are used in searches in
account_payment_order, which becomes really slow when a database have
many lines.
This commit is contained in:
Guewen Baconnier
2019-05-07 11:25:35 +02:00
committed by Carlos Roca
parent a8c3920627
commit 2769011d68
37 changed files with 1624 additions and 344 deletions

View File

@@ -15,7 +15,9 @@ class AccountMoveLine(models.Model):
help='Bank account on which we should pay the supplier')
bank_payment_line_id = fields.Many2one(
'bank.payment.line', string='Bank Payment Line',
readonly=True)
readonly=True,
index=True,
)
payment_line_ids = fields.One2many(
comodel_name='account.payment.line',
inverse_name='move_line_id',