From 14308b8c92d3a9625eb303aa705f7d9ff59b1e73 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 17 May 2013 12:47:54 +0200 Subject: [PATCH] [IMP] portal_crm: overwrite error message to portal managment bzr revid: chm@openerp.com-20130517104754-n13kq2cg3e1msta7 --- addons/portal_crm/__init__.py | 1 + addons/portal_crm/wizard/__init__.py | 25 ++++++++++++++ addons/portal_crm/wizard/portal_wizard.py | 41 +++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 addons/portal_crm/wizard/__init__.py create mode 100644 addons/portal_crm/wizard/portal_wizard.py diff --git a/addons/portal_crm/__init__.py b/addons/portal_crm/__init__.py index 92b3ac62321..cfd48eddc52 100644 --- a/addons/portal_crm/__init__.py +++ b/addons/portal_crm/__init__.py @@ -20,3 +20,4 @@ ############################################################################## import contact +import wizard diff --git a/addons/portal_crm/wizard/__init__.py b/addons/portal_crm/wizard/__init__.py new file mode 100644 index 00000000000..2fd59f43322 --- /dev/null +++ b/addons/portal_crm/wizard/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2011 OpenERP S.A (). +# +# 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 portal_wizard + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/portal_crm/wizard/portal_wizard.py b/addons/portal_crm/wizard/portal_wizard.py new file mode 100644 index 00000000000..ff3b1562fb0 --- /dev/null +++ b/addons/portal_crm/wizard/portal_wizard.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2011 OpenERP S.A (). +# +# 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 logging + +from openerp.osv import osv +from openerp.tools.translate import _ + +_logger = logging.getLogger(__name__) + +class wizard_user(osv.osv_memory): + _inherit = 'portal.wizard.user' + + def action_apply(self, cr, uid, ids, context=None): + try: + return super(wizard_user, self).action_apply(cr, uid, ids, context) + except osv.except_osv, e: + raise osv.except_osv(e[0], "%s\n\n%s" % (e[1], _("To resolve this error, you can:\ + Change and use an other contact's email adresse; \ + Select other contacts; \ + Use the partner merge action (more option of the contacts list) to merge the identical partners."))) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: