diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-06-04 10:01:34 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-06-04 10:01:34 +0200 |
| commit | 6a16fd4a786fc7b2e033e306d22bcbc235a4772d (patch) | |
| tree | d5df66ce9449d046464e1151d064d97f64c2e71e /addons/project_mailgate | |
| parent | fe0115f13abc8bb6d6fc8b1b8d01220e580e4997 (diff) | |
| parent | 37e59e65b393034b4cc3fe79521be9525b650960 (diff) | |
[MERGE] Merged with main addons.
bzr revid: tde@openerp.com-20120604080134-t1zg2sv0jpmhbyge
Diffstat (limited to 'addons/project_mailgate')
| -rw-r--r-- | addons/project_mailgate/__openerp__.py | 3 | ||||
| -rw-r--r-- | addons/project_mailgate/project_mailgate.py | 48 | ||||
| -rw-r--r-- | addons/project_mailgate/project_mailgate_view.xml | 22 |
3 files changed, 4 insertions, 69 deletions
diff --git a/addons/project_mailgate/__openerp__.py b/addons/project_mailgate/__openerp__.py index 6f521f436fa..cd66daa031e 100644 --- a/addons/project_mailgate/__openerp__.py +++ b/addons/project_mailgate/__openerp__.py @@ -26,7 +26,6 @@ "author": "OpenERP SA", "website": "http://www.openerp.com", "category": "Project Management", - 'complexity': "easy", "images": ["images/project_mailgate_task.jpeg"], "depends": ["project", "mail"], "description": """ @@ -46,7 +45,7 @@ There are two common alternatives to configure the mailbox integration: """, "init_xml": [], "update_xml": [ - "project_mailgate_view.xml", + "security/ir.model.access.csv", ], 'demo_xml': [ ], diff --git a/addons/project_mailgate/project_mailgate.py b/addons/project_mailgate/project_mailgate.py index 9715a32c151..a36366f450e 100644 --- a/addons/project_mailgate/project_mailgate.py +++ b/addons/project_mailgate/project_mailgate.py @@ -26,21 +26,14 @@ 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) subject = msg.get('subject') - body = msg.get('body_text') msg_from = msg.get('from') data = { 'name': subject, - 'description': body, 'planned_hours': 0.0, } data.update(self.message_partner_by_email(cr, uid, msg_from)) @@ -48,12 +41,9 @@ class project_tasks(osv.osv): return res_id def message_update(self, cr, uid, ids, msg, data={}, default_act='pending'): - data.update({ - 'description': msg['body_text'], - }) act = 'do_'+default_act - maps = { + maps = { 'cost':'planned_hours', } for line in msg['body_text'].split('\n'): @@ -73,7 +63,7 @@ class project_tasks(osv.osv): self.write(cr, uid, ids, data, context=context) getattr(self,act)(cr, uid, ids, context=context) - self.message_append_dict(cr, uid, [res_id], msg, context=context) + self.message_append_note(cr, uid, [res_id], body=msg, context=context) return True def message_thread_followers(self, cr, uid, ids, context=None): @@ -84,37 +74,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: diff --git a/addons/project_mailgate/project_mailgate_view.xml b/addons/project_mailgate/project_mailgate_view.xml deleted file mode 100644 index ea9855e9ec1..00000000000 --- a/addons/project_mailgate/project_mailgate_view.xml +++ /dev/null @@ -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> |
