[FIX] : tde's last remark correction

bzr revid: jem@openerp.com-20140226164521-gccablfi8b6e36qr
This commit is contained in:
Jérôme 2014-02-26 17:45:21 +01:00
parent e799c68264
commit f664ff2ace
2 changed files with 15 additions and 12 deletions

View File

@ -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')
}

View File

@ -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)