[FIX] Account: fixed bug in method amount_change of class account_invoice_tax
authorpap (openerp) <pap@tinyerp.co.in>
Mon, 30 Aug 2010 10:27:03 +0000 (15:57 +0530)
committerpap (openerp) <pap@tinyerp.co.in>
Mon, 30 Aug 2010 10:27:03 +0000 (15:57 +0530)
bzr revid: pap@tinyerp.co.in-20100830102703-und6z4yrrgmwezvj

addons/account/account.py
addons/account/invoice.py

index 9e431f6..53f6e4f 100644 (file)
@@ -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:
index 601b856..c4b9c4a 100644 (file)
@@ -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: