+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Account voucher module improvement for OpenERP, Improve some account
+# module problems Copyright (C) 2020 L'Heureux Cyclage
+# (<http://www.heureux-cyclage.org>) Ludovic CHEVALIER
+#
+# This file is a part of Account module improvement
+#
+# Account module improvement 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.
+#
+# Account module improvement 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import osv
+from openerp.osv import orm
+from openerp.osv import fields
+from openerp.tools.translate import _
+
+
+class account_voucher(orm.Model):
+ _inherit = 'account.voucher'
+
+ def _get_exchange_lines(self, cr, uid, line, move_id, amount_residual, company_currency, current_currency, context=None):
+ try:
+ super(account_voucher, self)._get_exchange_lines(cr, uid, line, move_id, amount_residual, company_currency, current_currency, context=None)
+ except:
+ raise osv.except_osv(_('Error!'),_('An error occured due to a voucher.\nYou should try to modify it to solve this issue.\n-ID:%d\n- Name: %s\n- Type: %s') % (line.voucher_id.id, line.voucher_id.name, line.voucher_id.type))
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: