[FIX] registry: check if index exists before logging
The `update_db_index` method is called even if the field has no index (the check on `index` field attribute is here on purpose). Before 13f02a60 was applied, the call of `sql.drop_index` was taking care of the index existence if a `IF EXISTS` SQL statement, so even if the field had no index it wasn't causing any issue. With 13f02a60 applied, the log 'Keep unexpected index' is spam even if the field has actually no index at all in the database. This commit ensures to check the existence of the index before logging. closes odoo/odoo#75387 Signed-off-by:Xavier Morel (xmo) <xmo@odoo.com>
Loading
Please register or sign in to comment