From 039deb8db44e2f0b95ce3d94165f3760a93013f9 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Thu, 14 Oct 2010 14:09:10 +0530 Subject: [PATCH] [REF] account_voucher: correct warning on creating of voucher without base and tax code bzr revid: mra@mra-laptop-20101014083910-dovsndw2ccchzdq0 --- addons/account_voucher/account_voucher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 6991aa8e859..6883a53b13f 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -681,9 +681,9 @@ class account_voucher(osv.osv): 'account_tax_id':inv.tax_id.id, }) if move_line.get('account_tax_id', False): - tax_id = tax_obj.browse(cr, uid, [move_line['account_tax_id']], context=context)[0] - if not (tax_id.base_code_id and tax_id.tax_code_id): - raise osv.except_osv(_('No Account Base Code and Account Tax Code!'),_("You have to define account base code and account tax code on the '%s' tax!") % (tax_id.name)) + tax_data = tax_obj.browse(cr, uid, [move_line['account_tax_id']], context=context)[0] + if not (tax_data.base_code_id and tax_data.tax_code_id): + raise osv.except_osv(_('No Account Base Code and Account Tax Code!'),_("You have to configure account base code and account tax code on the '%s' tax!") % (tax_data.name)) master_line = move_line_pool.create(cr, uid, move_line) if line.move_line_id.id: rec_ids = [master_line, line.move_line_id.id]