[IMP] project_mailgate: remove message_id field and remove duplicate messages.
bzr revid: tpa@tinyerp.com-20120514051206-7plee6tvsqxqub9a
This commit is contained in:
@@ -46,7 +46,6 @@ There are two common alternatives to configure the mailbox integration:
|
||||
""",
|
||||
"init_xml": [],
|
||||
"update_xml": ["security/ir.model.access.csv",
|
||||
"project_mailgate_view.xml",
|
||||
],
|
||||
'demo_xml': [
|
||||
],
|
||||
|
||||
@@ -26,12 +26,7 @@ import binascii
|
||||
|
||||
|
||||
class project_tasks(osv.osv):
|
||||
_name = "project.task"
|
||||
_inherit = ['mail.thread','project.task']
|
||||
|
||||
_columns = {
|
||||
'message_ids': fields.one2many('mail.message', 'res_id', 'Messages', domain=[('model','=',_name)], readonly=True),
|
||||
}
|
||||
_inherit = 'project.task'
|
||||
|
||||
def message_new(self, cr, uid, msg, custom_values=None, context=None):
|
||||
res_id = super(project_tasks,self).message_new(cr, uid, msg, custom_values=custom_values, context=context)
|
||||
@@ -84,37 +79,5 @@ class project_tasks(osv.osv):
|
||||
followers[task.id] = filter(None, task_followers)
|
||||
return followers
|
||||
|
||||
def do_draft(self, cr, uid, ids, context=None):
|
||||
res = super(project_tasks, self).do_draft(cr, uid, ids, context)
|
||||
tasks = self.browse(cr, uid, ids, context=context)
|
||||
self.message_append(cr, uid, tasks, _('Draft'), context=context)
|
||||
return res
|
||||
|
||||
def do_open(self, cr, uid, ids, context=None):
|
||||
res = super(project_tasks, self).do_open(cr, uid, ids, context)
|
||||
tasks = self.browse(cr, uid, ids, context=context)
|
||||
self.message_append(cr, uid, tasks, _('Open'), context=context)
|
||||
return res
|
||||
|
||||
def do_pending(self, cr, uid, ids, context=None):
|
||||
res = super(project_tasks, self).do_pending(cr, uid, ids, context)
|
||||
tasks = self.browse(cr, uid, ids, context=context)
|
||||
self.message_append(cr, uid, tasks, _('Pending'), context=context)
|
||||
return res
|
||||
|
||||
def do_close(self, cr, uid, ids, context=None):
|
||||
res = super(project_tasks, self).do_close(cr, uid, ids, context)
|
||||
tasks = self.browse(cr, uid, ids, context=context)
|
||||
for task in tasks:
|
||||
if task.state == 'done':
|
||||
self.message_append(cr, uid, tasks, _('Done'), context=context)
|
||||
return res
|
||||
|
||||
def do_cancel(self, cr, uid, ids, context=None):
|
||||
res = super(project_tasks, self).do_cancel(cr, uid, ids, context=context)
|
||||
tasks = self.browse(cr, uid, ids, context=context)
|
||||
self.message_append(cr, uid, tasks, _('Cancel'), context=context)
|
||||
return res
|
||||
|
||||
project_tasks()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_task_mailgate_form" model="ir.ui.view">
|
||||
<field name="name">task.mailgate.form</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="project.view_task_form2"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook/page[@string='Extra Info']" position="before">
|
||||
<page string="History">
|
||||
<field name="message_ids" colspan="4" nolabel="1" mode="tree" readonly="1">
|
||||
<tree string="History">
|
||||
<field name="display_text" string="History Information"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user