_All_ client forms are trying to locate attachments of records, so they
are querying ir.attachment for their (res_model, res_id). Speed that up!
bzr revid: p_christ@hol.gr-
20100627200016-gt9cyafm97if51e5
'type': 'binary',
}
+ def _auto_init(self, cr, context=None):
+ super(ir_attachment, self)._auto_init(cr, context)
+ cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('ir_attachment_res_idx',))
+ if not cr.fetchone():
+ cr.execute('CREATE INDEX ir_attachment_res_idx ON ir_attachment (res_model, res_id)')
+ cr.commit()
+
ir_attachment()