mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-26 21:32:00 +02:00
19.0 vanilla
This commit is contained in:
parent
a1137a1456
commit
e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions
|
|
@ -0,0 +1,18 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo.tools import SQL
|
||||
|
||||
|
||||
class IrAttachment(models.Model):
|
||||
_inherit = 'ir.attachment'
|
||||
|
||||
def init(self):
|
||||
if self.env.registry.has_trigram:
|
||||
indexed_field = SQL('UNACCENT(index_content)') if self.env.registry.has_unaccent else SQL('index_content')
|
||||
|
||||
self.env.cr.execute(SQL('''
|
||||
CREATE INDEX IF NOT EXISTS ir_attachment_index_content_applicant_trgm_idx
|
||||
ON ir_attachment USING gin (%(indexed_field)s gin_trgm_ops)
|
||||
WHERE res_model = 'hr.applicant'
|
||||
''', indexed_field=indexed_field))
|
||||
Loading…
Add table
Add a link
Reference in a new issue