From b2395a0b37beabce604a1cd551eabfe96f3d1a89 Mon Sep 17 00:00:00 2001 From: "pap (openerp)" Date: Mon, 30 Aug 2010 15:57:03 +0530 Subject: [PATCH] [FIX] Account: fixed bug in method amount_change of class account_invoice_tax bzr revid: pap@tinyerp.co.in-20100830102703-und6z4yrrgmwezvj --- addons/account/account.py | 2 +- addons/account/invoice.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 9e431f65e7b..53f6e4f288c 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1000,7 +1000,7 @@ class account_move(osv.osv): @param context: context arguments, like lang, time zone @param limit: Returns first 'n' ids of complete result, default is 80. - @return: Returns a list of tupples containing id and name + @return: Returns a list of tuples containing id and name """ if not args: diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 601b856b5dd..c4b9c4a4d3f 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1497,12 +1497,13 @@ class account_invoice_tax(osv.osv): cur_obj = self.pool.get('res.currency') company_obj = self.pool.get('res.company') company_currency = False - tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] tax_sign = 1 - if tax_amount < 0: - tax_sign = -1 - elif tax_amount == 0: - tax_sign = 0 + if ids: + tax_amount = self.read(cr, uid, ids[0], ['tax_amount'])['tax_amount'] + if tax_amount < 0: + tax_sign = -1 + elif tax_amount == 0: + tax_sign = 0 if company_id: company_currency = company_obj.read(cr, uid, [company_id], ['currency_id'])[0]['currency_id'][0] if currency_id and company_currency: