From fbbbe76d00961944f629f45be235bc535d1cf0d6 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 7 Sep 2011 23:15:47 +0200 Subject: [PATCH] [IMP] project.issue: simplified mail composition wizard bzr revid: odo@openerp.com-20110907211547-nzcjbqpkw7kmx1zc --- addons/project_issue/__init__.py | 1 - addons/project_issue/project_issue.py | 4 +- addons/project_issue/wizard/__init__.py | 25 --------- .../wizard/email_compose_message.py | 55 ------------------- 4 files changed, 3 insertions(+), 82 deletions(-) delete mode 100644 addons/project_issue/wizard/__init__.py delete mode 100644 addons/project_issue/wizard/email_compose_message.py diff --git a/addons/project_issue/__init__.py b/addons/project_issue/__init__.py index 21efa34f6f4..f519698a60c 100644 --- a/addons/project_issue/__init__.py +++ b/addons/project_issue/__init__.py @@ -22,6 +22,5 @@ import project_issue import report -import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index b8585ab4f01..bbbead95c19 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -28,6 +28,8 @@ import time import tools from crm import wizard +wizard.mail_compose_message.SUPPORTED_MODELS.append('project.issue') + class project_issue_version(osv.osv): _name = "project.issue.version" _order = "name desc" @@ -404,7 +406,7 @@ class project_issue(crm.crm_case, osv.osv): } if priority: vals['priority'] = priority - vals.update(self.message_partner_by_email(cr, uid, msg.get('from', False))) + vals.update(self.message_partner_by_email(cr, uid, msg_from)) context.update({'state_to' : 'draft'}) if custom_values and isinstance(custom_values, dict): diff --git a/addons/project_issue/wizard/__init__.py b/addons/project_issue/wizard/__init__.py deleted file mode 100644 index 51d4faa47d6..00000000000 --- a/addons/project_issue/wizard/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). All Rights Reserved -# $Id$ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import email_compose_message - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_issue/wizard/email_compose_message.py b/addons/project_issue/wizard/email_compose_message.py deleted file mode 100644 index ffb708ebe35..00000000000 --- a/addons/project_issue/wizard/email_compose_message.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2010-Today OpenERP SA () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see -# -############################################################################## - -from osv import osv -from osv import fields -import tools - -class email_compose_message(osv.osv_memory): - _inherit = 'mail.compose.message' - - def get_value(self, cr, uid, model, resource_id, context=None): - ''' - To get values of the resource_id for the model - @param model: Object - @param resource_id: id of a record for which values to be read - - @return: Returns a dictionary - ''' - if context is None: - context = {} - result = super(email_compose_message, self).get_value(cr, uid, model, resource_id, context=context) - if model == 'project.issue' and resource_id: - model_obj = self.pool.get(model) - data = model_obj.browse(cr, uid , resource_id, context) - result.update({ - 'subject' : data.name or False, - 'email_to' : data.email_from or False, - 'email_from' : data.user_id and data.user_id.address_id and data.user_id.address_id.email or False, - 'body_text' : '\n' + (tools.ustr(data.user_id.signature or '')), - 'email_cc' : tools.ustr(data.email_cc or ''), - 'model': model, - 'res_id': resource_id, - }) - return result - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: