[FIX] analytic: change index name to remove warning

We had an index with the same name as would be generated by the ORM.
Instead of putting index=True as it is a bit of an hack, we just change the name of the index.

closes odoo/odoo#103945

Issue: https://github.com/odoo/odoo/issues/103473
X-original-commit: 819fa66546fbb53b808711b38c3296406c45c717
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
This commit is contained in:
gawa-odoo
2022-10-24 16:12:47 +02:00
parent c19fa29b93
commit 4e796124c5
+1 -1
View File
@@ -26,7 +26,7 @@ class AnalyticMixin(models.AbstractModel):
self.env.cr.execute(query, [self._table])
if self.env.cr.dictfetchone():
query = f"""
CREATE INDEX IF NOT EXISTS {self._table}_analytic_distribution_index
CREATE INDEX IF NOT EXISTS {self._table}_analytic_distribution_gin_index
ON {self._table} USING gin(analytic_distribution);
"""
self.env.cr.execute(query)