is_email=fields.Boolean('Sent by Email',index=True)
email_status=fields.Selection([
('ready','Ready to Send'),
('sent','Sent'),
('bounce','Bounced'),
('exception','Exception')],'Email Status',
default='ready',index=True)
@api.model_cr
definit(self):
self._cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s',('mail_notification_res_partner_id_is_read_email_status_mail_message_id',))
ifnotself._cr.fetchone():
self._cr.execute('CREATE INDEX mail_notification_res_partner_id_is_read_email_status_mail_message_id ON mail_message_res_partner_needaction_rel (res_partner_id, is_read, email_status, mail_message_id)')