[FIX] account: if tax is , total base is
authorRifakat <rha@tinyerp.com>
Thu, 13 Jun 2013 09:43:30 +0000 (15:13 +0530)
committerRifakat <rha@tinyerp.com>
Thu, 13 Jun 2013 09:43:30 +0000 (15:13 +0530)
applied only on the main tax and does not carry the child tax amount into base, it is compulsory to add child tax amount to tax base
becuase the next tax i.e. VAT is applied on total tax base amount

addons/account/account.py

index c2e75e8..418a4f7 100644 (file)
@@ -2088,12 +2088,15 @@ class account_tax(osv.osv):
                 data['balance'] = cur_price_unit
 
             amount2 = data.get('amount', 0.0)
+            amount3 = 0.0
             if tax.child_ids:
                 if tax.child_depend:
                     latest = res.pop()
                 amount = amount2
                 child_tax = self._unit_compute(cr, uid, tax.child_ids, amount, product, partner, quantity)
                 res.extend(child_tax)
+                for child in child_tax:
+                    amount3 += child.get('amount', 0.0)
                 if tax.child_depend:
                     for r in res:
                         for name in ('base','ref_base'):
@@ -2109,7 +2112,7 @@ class account_tax(osv.osv):
                                 r['amount'] = data['amount']
                                 latest[name+'_code_id'] = False
             if tax.include_base_amount:
-                cur_price_unit+=amount2
+                cur_price_unit += amount2 + amount3
         return res
 
     def compute_all(self, cr, uid, taxes, price_unit, quantity, product=None, partner=None, force_excluded=False):