From 5a03cc64d3958214a35e27c31ef71f50bb290b7a Mon Sep 17 00:00:00 2001 From: SEINLET Nicolas Date: Thu, 15 Oct 2020 06:22:17 +0000 Subject: [PATCH] [IMP] website_visitor: avoid double indexing unique constraint create an btree unbique index: ``` # \d website_visitor [...] Indexes: "website_visitor_pkey" PRIMARY KEY, btree (id) "website_visitor_access_token_unique" UNIQUE CONSTRAINT, btree (access_token) "website_visitor_partner_uniq" UNIQUE CONSTRAINT, btree (partner_id) ``` removing index=True avoid this double indexing. closes odoo/odoo#60120 X-original-commit: efb33e783bd04d542009ef0f57eba6a4aacbca65 Signed-off-by: Olivier Dony (odo) Signed-off-by: Nicolas Seinlet (nse) --- addons/website/models/website_visitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/website_visitor.py b/addons/website/models/website_visitor.py index 223353fa7d9..3995a438c7b 100644 --- a/addons/website/models/website_visitor.py +++ b/addons/website/models/website_visitor.py @@ -31,7 +31,7 @@ class WebsiteVisitor(models.Model): _order = 'last_connection_datetime DESC' name = fields.Char('Name') - access_token = fields.Char(required=True, default=lambda x: uuid.uuid4().hex, index=True, copy=False, groups='base.group_website_publisher') + access_token = fields.Char(required=True, default=lambda x: uuid.uuid4().hex, index=False, copy=False, groups='base.group_website_publisher') active = fields.Boolean('Active', default=True) website_id = fields.Many2one('website', "Website", readonly=True) partner_id = fields.Many2one('res.partner', string="Linked Partner", help="Partner of the last logged in user.")