Merge lp:~openerp-dev/openobject-addons/trunk-bug-995471-api into lp:openobject-addons

Proposed by Arnaud Pineux (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-995471-api
Merge into: lp:openobject-addons
Diff against target: 35 lines (+3/-9)
1 file modified
point_of_sale/report/pos_details.py (+3/-9)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-995471-api
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+137839@code.launchpad.net

Description of the change

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".

To post a comment you must log in.

Unmerged revisions

8193. By Arnaud Pineux (OpenERP)

[FIX] pos_detail report: show taxes fixed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'point_of_sale/report/pos_details.py'
2--- point_of_sale/report/pos_details.py 2012-11-29 22:26:45 +0000
3+++ point_of_sale/report/pos_details.py 2012-12-04 13:27:36 +0000
4@@ -21,6 +21,7 @@
5
6 import time
7 from report import report_sxw
8+from tools.translate import _
9
10 class pos_details(report_sxw.rml_parse):
11
12@@ -151,22 +152,15 @@
13 return self._ellipsis(name, maxlen, ' ...')
14
15 def _get_tax_amount(self, form):
16- res = {}
17 temp = {}
18- list_ids = []
19 temp2 = 0.0
20 user_ids = form['user_ids'] or self._get_all_users()
21 pos_order_obj = self.pool.get('pos.order')
22 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)])
23- temp.update({'name': ''})
24+ label = _("Sum of taxes")
25+ temp.update({'name': label})
26 for order in pos_order_obj.browse(self.cr, self.uid, pos_ids):
27 temp2 += order.amount_tax
28- for line in order.lines:
29- if len(line.product_id.taxes_id):
30- tax = line.product_id.taxes_id[0]
31- 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)
32- list_ids.append(tax.id)
33- temp.update({'name': tax.name})
34 temp.update({'amount': temp2})
35 return [temp] or False
36

Subscribers

People subscribed via source and target branches

to all changes: