From 444249a49161075764fd822e4dd8b1ae86f6f01a Mon Sep 17 00:00:00 2001 From: Dave Lasley Date: Thu, 24 Aug 2017 20:36:59 -0700 Subject: [PATCH] [IMP] partner_firstname: Add indices * Add index to first and last name in order to allow for quicker searches - fixing an incredibly slow update time with large dbs --- partner_firstname/models/res_partner.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/partner_firstname/models/res_partner.py b/partner_firstname/models/res_partner.py index e27997841..b9b6bfe7d 100644 --- a/partner_firstname/models/res_partner.py +++ b/partner_firstname/models/res_partner.py @@ -14,8 +14,14 @@ class ResPartner(models.Model): """Adds last name and first name; name becomes a stored function field.""" _inherit = 'res.partner' - firstname = fields.Char("First name") - lastname = fields.Char("Last name") + firstname = fields.Char( + "First name", + index=True, + ) + lastname = fields.Char( + "Last name", + index=True, + ) name = fields.Char( compute="_compute_name", inverse="_inverse_name_after_cleaning_whitespace",