diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py
index 7801a9b42d9..15e9121cee9 100644
--- a/addons/mail/mail_message.py
+++ b/addons/mail/mail_message.py
@@ -199,9 +199,9 @@ class mail_message(osv.Model):
'nodestroy': True
})
return action_data
-
+
_columns = {
- 'type': fields.selection([
+ 'message_type': fields.selection([
('email', 'email'),
('comment', 'Comment'),
('notification', 'System notification'),
@@ -235,16 +235,16 @@ class mail_message(osv.Model):
help="Parent message, used for displaying as threads with hierarchy"),
'child_ids': fields.one2many('mail.message', 'parent_id', 'Child Messages'),
}
-
+
_defaults = {
- 'type': 'email',
+ 'message_type': 'email',
'state': 'received',
}
-
+
#------------------------------------------------------
# Email api
#------------------------------------------------------
-
+
def init(self, cr):
cr.execute("""SELECT indexname FROM pg_indexes WHERE indexname = 'mail_message_model_res_id_idx'""")
if not cr.fetchone():
@@ -356,7 +356,7 @@ class mail_message(osv.Model):
'user_id': uid,
'model': model,
'res_id': res_id,
- 'type': type,
+ 'message_type': type,
'body_text': body if content_subtype != 'html' else False,
'body_html': body if content_subtype == 'html' else False,
'email_from': email_from,
@@ -414,7 +414,7 @@ class mail_message(osv.Model):
if context is None:
context = {}
if not ids:
- filters = ['&', ('state', '=', 'outgoing'), ('type', '=', 'email')]
+ filters = ['&', ('state', '=', 'outgoing'), ('message_type', '=', 'email')]
if 'filters' in context:
filters.extend(context['filters'])
ids = self.search(cr, uid, filters, context=context)
diff --git a/addons/mail/mail_message_view.xml b/addons/mail/mail_message_view.xml
index 0aa5261d7e7..614b70820d0 100644
--- a/addons/mail/mail_message_view.xml
+++ b/addons/mail/mail_message_view.xml
@@ -30,7 +30,7 @@
-
+
@@ -75,19 +75,19 @@
-
+
+ domain="[('message_type', '=', 'comment')]"/>
+ domain="[('message_type', '=', 'notification')]"/>
+ domain="[('message_type', '=', 'email')]"/>
-
+
@@ -205,9 +205,9 @@
-
-
-
+
+
+
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index 56c7e6b7088..1168a677472 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -440,7 +440,7 @@ class mail_thread(osv.Model):
'body_html': body_html or '',
'parent_id': parent_id,
'date': email_date or fields.datetime.now(),
- 'type': type,
+ 'message_type': type,
'content_subtype': content_subtype,
'state': state,
'message_id': message_id,
@@ -491,7 +491,7 @@ class mail_thread(osv.Model):
body_text = msg_dict.get('body_text'),
body_html= msg_dict.get('body_html'),
parent_id = msg_dict.get('parent_id', False),
- type = msg_dict.get('type', 'email'),
+ message_type = msg_dict.get('message_type', 'email'),
content_subtype = msg_dict.get('content_subtype'),
state = msg_dict.get('state'),
partner_ids = msg_dict.get('partner_ids'),
@@ -1107,7 +1107,7 @@ class mail_thread(osv.Model):
if body_text:
body_text += '\n\n----------\nThis email was send automatically by OpenERP, because you have subscribed to a document.'
values.update({
- 'type': 'email',
+ 'message_type': 'email',
'state': 'outgoing',
'email_from': email_from,
'email_to': email_to,