Dharti Ratani(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-opw-577466-port-dhr into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-577466-port-dhr/+merge/138382

To Reproduce :

Create a Tax with two child taxes having below configuration:

   child 1 : Percentage , 0.0020, Mark Boolean field labeled "Include in base 
Amount" , sequence 1
   child 2 : Percentage , 0.1960, sequence 2

"Tax on Children" should be True to compute based on Child Taxes.

Create an Invoice Line with amount 100. Tax is working fine(amount:19.84).

It shows wrong Amount in Base. Base Amount is calculated twice.

Code is forward port from 6.1
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-577466-port-dhr/+merge/138382
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-opw-577466-port-dhr.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py	2012-12-05 11:28:53 +0000
+++ account/account_invoice.py	2012-12-06 05:37:22 +0000
@@ -1708,9 +1708,14 @@
                 if not key in tax_grouped:
                     tax_grouped[key] = val
                 else:
+                    for rec in line.invoice_line_tax_id:
+                        if rec.child_ids:
+                            tax_grouped[key]['base'] = line ['price_unit'] * line['quantity']
+                            tax_grouped[key]['base_amount'] = val['base_amount']
+                        else:
+                            tax_grouped[key]['base'] += val['base']
+                            tax_grouped[key]['base_amount'] += val['base_amount']
                     tax_grouped[key]['amount'] += val['amount']
-                    tax_grouped[key]['base'] += val['base']
-                    tax_grouped[key]['base_amount'] += val['base_amount']
                     tax_grouped[key]['tax_amount'] += val['tax_amount']
 
         for t in tax_grouped.values():

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to