From f664ff2ace0a9fa73379156d7f423a43b0bbe327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me?= Date: Wed, 26 Feb 2014 17:45:21 +0100 Subject: [PATCH] [FIX] : tde's last remark correction bzr revid: jem@openerp.com-20140226164521-gccablfi8b6e36qr --- addons/crm_project_issue/project_issue.py | 25 +++++++++++++---------- addons/mail/mail_thread.py | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/addons/crm_project_issue/project_issue.py b/addons/crm_project_issue/project_issue.py index b541bcf2eea..02fc8320b62 100644 --- a/addons/crm_project_issue/project_issue.py +++ b/addons/crm_project_issue/project_issue.py @@ -1,9 +1,23 @@ from openerp.osv import osv, fields + class crm_lead_to_project_issue_wizard(osv.TransientModel): """ wizard to convert a Lead into a Project Issue and move the Mail Thread """ + _name = "crm.lead2projectissue.wizard" + + _inherit = 'crm.partner.binding' + + _columns = { + "lead_id" : fields.many2one("crm.lead","Lead", domain=[("type","=","lead")]), + "project_id" : fields.many2one("project.project", "Project", domain=[("use_issues","=",True)]) + } + + _defaults = { + "lead_id" : lambda self, cr, uid, context=None: context.get('active_id') + } + def action_lead_to_project_issue(self, cr, uid, ids, context=None): # get the wizards and models wizards = self.browse(cr, uid, ids, context=context) @@ -45,14 +59,3 @@ class crm_lead_to_project_issue_wizard(osv.TransientModel): 'context' : context } - - _name = "crm.lead2projectissue.wizard" - _inherit = 'crm.partner.binding' - _columns = { - "lead_id" : fields.many2one("crm.lead","Lead", domain=[("type","=","lead")]), - "project_id" : fields.many2one("project.project", "Project", domain=[("use_issues","=",True)]) - } - - _defaults = { - "lead_id" : lambda self, cr, uid, context=None: context.get('active_id') - } \ No newline at end of file diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 6ef098644ac..fed5216470f 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -1822,7 +1822,7 @@ class mail_thread(osv.AbstractModel): msg_ids_not_comment = message_obj.search(cr, uid, [ ('model', '=', self._name), ('res_id', '=', id), - ('subtype_id.id', '!=', subtype_res_id)], context=context) + ('subtype_id', '!=', subtype_res_id)], context=context) # update the messages message_obj.write(cr, uid, msg_ids_comment, {"res_id" : new_res_id, "model" : new_model}, context=context)