diff --git a/addons/email/email_view.xml b/addons/email/email_view.xml
index d05bfbc0d91..07fe21db4cf 100644
--- a/addons/email/email_view.xml
+++ b/addons/email/email_view.xml
@@ -5,104 +5,6 @@
-
- mailgate.message.form
- mailgate.message
- form
-
-
-
-
-
-
- mailgate.message.tree
- mailgate.message
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mailgate.message.search
- mailgate.message
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Messages
- mailgate.message
- form
- tree,form
-
-
-
-
-
-
mailgate.thread.form
mailgate.thread
@@ -177,16 +79,6 @@
-
-
- Emails
- mailgate.message
- tree,form
- form
- [('history', '=', True)]
-
-
-
tree
@@ -200,21 +92,5 @@
-
-
-
-
-
-
diff --git a/addons/email/emails.py b/addons/email/emails.py
index b23aea0c901..c736edebaf7 100644
--- a/addons/email/emails.py
+++ b/addons/email/emails.py
@@ -179,124 +179,6 @@ def format_date_tz(date, tz=None):
format = tools.DEFAULT_SERVER_DATETIME_FORMAT
return tools.server_to_local_timestamp(date, format, format, tz)
-class mailgate_message(osv.osv):
- '''
- Mailgateway Message
- '''
- def open_document(self, cr, uid, ids, context=None):
- """ To Open Document
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID of messages
- @param context: A standard dictionary
- """
- action_data = False
- if ids:
- message_id = ids[0]
- mailgate_data = self.browse(cr, uid, message_id, context=context)
- model = mailgate_data.model
- res_id = mailgate_data.res_id
-
- action_pool = self.pool.get('ir.actions.act_window')
- action_ids = action_pool.search(cr, uid, [('res_model', '=', model)])
- if action_ids:
- action_data = action_pool.read(cr, uid, action_ids[0], context=context)
- action_data.update({
- 'domain' : "[('id','=',%d)]"%(res_id),
- 'nodestroy': True,
- 'context': {}
- })
- return action_data
-
- def open_attachment(self, cr, uid, ids, context=None):
- """ To Open attachments
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID of messages
- @param context: A standard dictionary
- """
- action_data = False
- action_pool = self.pool.get('ir.actions.act_window')
- message_pool = self.browse(cr ,uid, ids, context=context)[0]
- att_ids = [x.id for x in message_pool.attachment_ids]
- action_ids = action_pool.search(cr, uid, [('res_model', '=', 'ir.attachment')])
- if action_ids:
- action_data = action_pool.read(cr, uid, action_ids[0], context=context)
- action_data.update({
- 'domain': [('id','in',att_ids)],
- 'nodestroy': True
- })
- return action_data
-
- def truncate_data(self, cr, uid, data, context=None):
- data_list = data and data.split('\n') or []
- if len(data_list) > 3:
- res = '\n\t'.join(data_list[:3]) + '...'
- else:
- res = '\n\t'.join(data_list)
- return res
-
- def _get_display_text(self, cr, uid, ids, name, arg, context=None):
- if context is None:
- context = {}
- tz = context.get('tz')
- result = {}
- for message in self.browse(cr, uid, ids, context=context):
- msg_txt = ''
- if message.history:
- msg_txt += (message.email_from or '/') + _(' wrote on ') + format_date_tz(message.date, tz) + ':\n\t'
- if message.description:
- msg_txt += self.truncate_data(cr, uid, message.description, context=context)
- else:
- msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t'
- if message.name == _('Opportunity'):
- msg_txt += _("Converted to Opportunity")
- elif message.name == _('Note'):
- msg_txt = (message.user_id.name or '/') + _(' added note on ') + format_date_tz(message.date, tz) + ':\n\t'
- msg_txt += self.truncate_data(cr, uid, message.description, context=context)
- elif message.name == _('Stage'):
- msg_txt += _("Changed Stage to: ") + message.description
- else:
- msg_txt += _("Changed Status to: ") + message.name
- result[message.id] = msg_txt
- return result
-
- _name = 'mailgate.message'
- _description = 'Mailgateway Message'
- _order = 'date desc'
- _columns = {
- 'name':fields.text('Subject', readonly=True),
- 'model': fields.char('Object Name', size=128, select=1, readonly=True),
- 'res_id': fields.integer('Resource ID', select=1, readonly=True),
- 'ref_id': fields.char('Reference Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
- 'date': fields.datetime('Date', readonly=True),
- 'history': fields.boolean('Is History?', readonly=True),
- 'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
- 'message': fields.text('Description', readonly=True),
- 'email_from': fields.char('From', size=128, help="Email From", readonly=True),
- 'email_to': fields.char('To', help="Email Recipients", size=256, readonly=True),
- 'email_cc': fields.char('Cc', help="Carbon Copy Email Recipients", size=256, readonly=True),
- 'email_bcc': fields.char('Bcc', help='Blind Carbon Copy Email Recipients', size=256, readonly=True),
- 'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email.", select=True),
- 'references': fields.text('References', readonly=True, help="References emails."),
- 'description': fields.text('Description', readonly=True),
- 'partner_id': fields.many2one('res.partner', 'Partner', required=False),
- 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments', readonly=True),
- 'display_text': fields.function(_get_display_text, method=True, type='text', size="512", string='Display Text'),
- }
-
- def init(self, cr):
- cr.execute("""SELECT indexname
- FROM pg_indexes
- WHERE indexname = 'mailgate_message_res_id_model_idx'""")
- if not cr.fetchone():
- cr.execute("""CREATE INDEX mailgate_message_res_id_model_idx
- ON mailgate_message (model, res_id)""")
-
-mailgate_message()
-
class mailgate_tool(osv.osv_memory):
_name = 'email.server.tools'
diff --git a/addons/email/security/ir.model.access.csv b/addons/email/security/ir.model.access.csv
index 09f13d57b31..c3c59418edb 100644
--- a/addons/email/security/ir.model.access.csv
+++ b/addons/email/security/ir.model.access.csv
@@ -1,5 +1,2 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"mail_gateway_mailgate_message","mail_gateway.mailgate.message","model_mailgate_message","base.group_system",1,1,1,1
"mail_gateway_mailgate_thread","mail_gateway.mailgate.thread","model_mailgate_thread","base.group_system",1,1,1,1
-"mail_gateway_message_internal_user","mail_gateway.mailgate.message.internal","model_mailgate_message","base.group_user",1,0,0,0
-"mail_gateway_mailgate_message_partner_manager","mail_gateway.mailgate.message.partner.manager","model_mailgate_message","base.group_partner_manager",1,1,1,1
diff --git a/addons/email_gateway/email_gateway.py b/addons/email_gateway/email_gateway.py
index b153d200e5c..bfd05d3ccfe 100644
--- a/addons/email_gateway/email_gateway.py
+++ b/addons/email_gateway/email_gateway.py
@@ -152,10 +152,10 @@ class email_message(osv.osv):
def init(self, cr):
cr.execute("""SELECT indexname
FROM pg_indexes
- WHERE indexname = 'mailgate_message_res_id_model_idx'""")
+ WHERE indexname = 'email_message_res_id_model_idx'""")
if not cr.fetchone():
- cr.execute("""CREATE INDEX mailgate_message_res_id_model_idx
- ON mailgate_message (model, res_id)""")
+ cr.execute("""CREATE INDEX email_message_res_id_model_idx
+ ON email_message (model, res_id)""")
# def run_mail_scheduler(self, cursor, user, context=None):
# """
diff --git a/addons/email_gateway/email_gateway_view.xml b/addons/email_gateway/email_gateway_view.xml
index b8f8415c389..c63fede566b 100644
--- a/addons/email_gateway/email_gateway_view.xml
+++ b/addons/email_gateway/email_gateway_view.xml
@@ -97,14 +97,14 @@