diff --git a/addons/crm_helpdesk/__init__.py b/addons/crm_helpdesk/__init__.py index 7dca88af720..5d270dbebf8 100644 --- a/addons/crm_helpdesk/__init__.py +++ b/addons/crm_helpdesk/__init__.py @@ -21,7 +21,6 @@ import crm_helpdesk import report -import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py index 942de0a0508..48bc2a1bb2e 100644 --- a/addons/crm_helpdesk/crm_helpdesk.py +++ b/addons/crm_helpdesk/crm_helpdesk.py @@ -23,7 +23,6 @@ from crm import crm from osv import fields, osv import time from crm import wizard -import binascii import tools from tools.translate import _ @@ -33,6 +32,8 @@ CRM_HELPDESK_STATES = ( crm.AVAILABLE_STATES[4][0], # Pending ) +wizard.mail_compose_message.SUPPORTED_MODELS.append('crm.helpdesk') + class crm_helpdesk(crm.crm_case, osv.osv): """ Helpdesk Cases """ @@ -107,7 +108,7 @@ class crm_helpdesk(crm.crm_case, osv.osv): 'description': body, 'user_id': False, } - vals.update(self.message_partner_by_email(cr, uid, msg_dict.get('from', False))) + vals.update(self.message_partner_by_email(cr, uid, msg_from)) self.write(cr, uid, [res_id], vals, context) return res_id diff --git a/addons/crm_helpdesk/wizard/__init__.py b/addons/crm_helpdesk/wizard/__init__.py deleted file mode 100644 index 6e9830a5f3a..00000000000 --- a/addons/crm_helpdesk/wizard/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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/crm_helpdesk/wizard/email_compose_message.py b/addons/crm_helpdesk/wizard/email_compose_message.py deleted file mode 100644 index 8b147023bb3..00000000000 --- a/addons/crm_helpdesk/wizard/email_compose_message.py +++ /dev/null @@ -1,62 +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): - ''' - """Returns a defaults-like dict with initial values for the composition - wizard when sending an email related to the document record identified - by ``model`` and ``res_id``. - - Overrides the default implementation to provide more default field values - related to the corresponding CRM case. - - :param str model: model name of the document record this mail is related to. - :param int res_id: id of the document record this mail is related to. - :param dict context: several context values will modify the behavior - of the wizard, cfr. the class description. - ''' - if context is None: - context = {} - result = super(email_compose_message, self).get_value(cr, uid, model, resource_id, context=context) - if model == 'crm.helpdesk' 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 - -email_compose_message() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: