Arnaud Pineux (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-995471-api into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #995471 in OpenERP Addons: "[6.1]/[trunk] POS report pos_detail list 
taxes issue"
  https://bugs.launchpad.net/openobject-addons/+bug/995471

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-995471-api/+merge/137839

In the report 'pos_details' the bug was that the taxes' label equaled the name 
of the last tax but the value shown equaled the sum of all taxes amount. 
Therefore the label and value didn't correspond.
To resolve that the label is now equals to "Sum of Taxes".

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-995471-api/+merge/137839
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-995471-api.
=== modified file 'point_of_sale/report/pos_details.py'
--- point_of_sale/report/pos_details.py	2012-11-29 22:26:45 +0000
+++ point_of_sale/report/pos_details.py	2012-12-04 13:27:36 +0000
@@ -21,6 +21,7 @@
 
 import time
 from report import report_sxw
+from tools.translate import _
 
 class pos_details(report_sxw.rml_parse):
 
@@ -151,22 +152,15 @@
         return self._ellipsis(name, maxlen, ' ...')
 
     def _get_tax_amount(self, form):
-        res = {}
         temp = {}
-        list_ids = []
         temp2 = 0.0
         user_ids = form['user_ids'] or self._get_all_users()
         pos_order_obj = self.pool.get('pos.order')
         pos_ids = pos_order_obj.search(self.cr, self.uid, [('date_order','>=',form['date_start'] + ' 00:00:00'),('date_order','<=',form['date_end'] + ' 23:59:59'),('state','in',['paid','invoiced','done']),('user_id','in',user_ids)])
-        temp.update({'name': ''})
+        label = _("Sum of taxes")
+        temp.update({'name': label})
         for order in pos_order_obj.browse(self.cr, self.uid, pos_ids):
             temp2 += order.amount_tax
-            for line in order.lines:
-                if len(line.product_id.taxes_id):
-                    tax = line.product_id.taxes_id[0]
-                    res[tax.name] = (line.price_unit * line.qty * (1-(line.discount or 0.0) / 100.0)) + (tax.id in list_ids and res[tax.name] or 0)
-                    list_ids.append(tax.id)
-                    temp.update({'name': tax.name})
         temp.update({'amount': temp2})
         return [temp] or False
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to