Browse Source

[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
pull/487/head
Dave Lasley 7 years ago
committed by Enric Tobella
parent
commit
444249a491
  1. 10
      partner_firstname/models/res_partner.py

10
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",

Loading…
Cancel
Save