[MODULE] -blank line
[burette/account_voucher_improvement.git] / account_voucher.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #
4 # Account voucher module improvement for OpenERP, Improve some account
5 # module problems Copyright (C) 2020 L'Heureux Cyclage
6 # (<http://www.heureux-cyclage.org>) Ludovic CHEVALIER
7 #
8 # This file is a part of Account module improvement
9 #
10 # Account module improvement is free software: you can redistribute it
11 # and/or modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation, either version 3 of the
13 # License, or (at your option) any later version.
14 #
15 # Account module improvement is distributed in the hope that it will be
16 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18 # Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License along
21 # with this program. If not, see <http://www.gnu.org/licenses/>.
22 #
23 ##############################################################################
24
25 from openerp.osv import osv
26 from openerp.osv import orm
27 from openerp.osv import fields
28 from openerp.tools.translate import _
29
30
31 class account_voucher(orm.Model):
32 _inherit = 'account.voucher'
33
34 def _get_exchange_lines(self, cr, uid, line, move_id, amount_residual, company_currency, current_currency, context=None):
35 try:
36 super(account_voucher, self)._get_exchange_lines(cr, uid, line, move_id, amount_residual, company_currency, current_currency, context=None)
37 except:
38 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))
39
40 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: