def _auto_init(self): res = super(IrTranslation, self)._auto_init() # Add separate md5 index on src (no size limit on values, and good performance). tools.create_index(self._cr, 'ir_translation_src_md5', self._table, ['md5(src)']) tools.create_index(self._cr, 'ir_translation_ltn', self._table, ['name', 'lang', 'type']) return res
def _auto_init(self): res = super(IrTranslation, self)._auto_init() # Add separate md5 index on src (no size limit on values, and good performance). tools.create_index(self._cr, 'ir_translation_src_md5', self._table, ['md5(src)']) # Cover 'model_terms' type tools.create_unique_index( self._cr, 'ir_translation_unique', self._table, ['type', 'name', 'lang', 'res_id', 'md5(src)']) if not tools.index_exists(self._cr, 'ir_translation_code_unique'): self._cr.execute( "CREATE UNIQUE INDEX ir_translation_code_unique ON ir_translation (type, lang, md5(src)) WHERE type = 'code'" ) if not tools.index_exists(self._cr, 'ir_translation_model_unique'): self._cr.execute( "CREATE UNIQUE INDEX ir_translation_model_unique ON ir_translation (type, lang, name, res_id) WHERE type = 'model'" ) return res
def _auto_init(self): res = super(IrAttachment, self)._auto_init() tools.create_index(self._cr, 'ir_attachment_res_idx', self._table, ['res_model', 'res_id']) return res
def init(self): tools.create_index(self._cr, "hr_work_entry_date_start_date_stop_index", self._table, ["date_start", "date_stop"])
def init(self): tools.create_index(self._cr, 'account_move_line_move_product_index', self._table, ['move_id', 'product_id'])
def init(self): tools.create_index(self._cr, 'stock_valuation_layer_index', self._table, [ 'product_id', 'remaining_qty', 'stock_move_id', 'company_id', 'create_date' ])