[IMP] Replace field name type with message_type.
bzr revid: bth@tinyerp.com-20120822112137-u6i2dujnpisk7t1p
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<field name="subject"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date"/>
|
||||
<field name="type"/>
|
||||
<field name="message_type"/>
|
||||
<field name="content_subtype"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -75,19 +75,19 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Messages Search">
|
||||
<field name="subject" string="Content" filter_domain="['|', ('subject', 'ilike', self), ('body', 'ilike', self)]" />
|
||||
<field name="type"/>
|
||||
<field name="message_type"/>
|
||||
<filter icon="terp-personal+" string="My Feeds"
|
||||
name="my_feeds" help="My Feeds"
|
||||
domain="[('user_id','=',uid)]"/>
|
||||
<filter icon="terp-personal+" string="Comments"
|
||||
name="comments" help="Comments"
|
||||
domain="[('type', '=', 'comment')]"/>
|
||||
domain="[('message_type', '=', 'comment')]"/>
|
||||
<filter icon="terp-personal+" string="Notifications"
|
||||
name="notifications" help="Notifications"
|
||||
domain="[('type', '=', 'notification')]"/>
|
||||
domain="[('message_type', '=', 'notification')]"/>
|
||||
<filter icon="terp-personal+" string="Emails"
|
||||
name="emails" help="Emails"
|
||||
domain="[('type', '=', 'email')]"/>
|
||||
domain="[('message_type', '=', 'email')]"/>
|
||||
<filter icon="terp-go-today" string="Today"
|
||||
name="today" help="Today"
|
||||
domain="[ ('date', '<=', datetime.date.today().strftime('%%Y-%%m-%%d 23:59:59')),
|
||||
@@ -144,7 +144,7 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="auto_delete"/>
|
||||
<field name="type"/>
|
||||
<field name="message_type"/>
|
||||
<field name="content_subtype"/>
|
||||
<field name="state" colspan="2"/>
|
||||
<field name="mail_server_id"/>
|
||||
@@ -205,9 +205,9 @@
|
||||
<filter icon="terp-check" name="sent" string="Sent" domain="[('state','=','sent')]"/>
|
||||
<filter icon="terp-gtk-stop" name="exception" string="Failed" domain="[('state','=','exception')]"/>
|
||||
<separator/>
|
||||
<filter icon="terp-camera_test" name="type_email" string="Email" domain="[('type','=','email')]"/>
|
||||
<filter icon="terp-camera_test" name="type_comment" string="Comment" domain="[('type','=','comment')]"/>
|
||||
<filter icon="terp-camera_test" name="type_notification" string="Notification" domain="[('type','=','notification')]"/>
|
||||
<filter icon="terp-camera_test" name="type_email" string="Email" domain="[('message_type','=','email')]"/>
|
||||
<filter icon="terp-camera_test" name="type_comment" string="Comment" domain="[('message_type','=','comment')]"/>
|
||||
<filter icon="terp-camera_test" name="type_notification" string="Notification" domain="[('message_type','=','notification')]"/>
|
||||
<group expand="0" string="Extended Filters...">
|
||||
<field name="user_id" string="User"/>
|
||||
<field name="partner_id" string="Partner Name"/>
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user