Merge lp:~alejandrosantana/ocb-addons/6.1-ocb-addons-fix-bug-1089229 into lp:ocb-addons/6.1

Proposed by Alejandro Santana
Status: Work in progress
Proposed branch: lp:~alejandrosantana/ocb-addons/6.1-ocb-addons-fix-bug-1089229
Merge into: lp:ocb-addons/6.1
Diff against target: 131 lines (+11/-43)
1 file modified
sale/report/sale_order.rml (+11/-43)
To merge this branch: bzr merge lp:~alejandrosantana/ocb-addons/6.1-ocb-addons-fix-bug-1089229
Reviewer Review Type Date Requested Status
Alejandro Santana (community) Needs Information
Serv. Tecnológicos Avanzados - Pedro M. Baeza Pending
Review via email: mp+202036@code.launchpad.net

Commit message

[FIX] Fixes the sales order report to show correctly the unit price if UoS is definied. Also corrects the decimal precision of subtotals, total untaxed, taxes and total taxed.

Description of the change

Fixes bug lp:1089229
[FIX] Fixes the sales order report to show correctly the unit price if UoS is definied. Also corrects the decimal precision of subtotals, total untaxed, taxes and total taxed.

To post a comment you must log in.
6827. By Alejandro Santana

[FIX] Fixes the sales order report to show correctly the unit price if UoS is definied. Also corrects the decimal precision of subtotals, total untaxed, taxes and total taxed.

Revision history for this message
Alejandro Santana (alejandrosantana) wrote :

Same as MP in v7.0 (https://code.launchpad.net/~alejandrosantana/ocb-addons/7.0-ocb-addons-fix-bug-1089229/+merge/202233):
"
OK, despite the pure mathematics, I set myself as 'Needs fixing', because rounding calculations make mandatory to compute subtotal as shown in the report:
product_uos_qty (dp as "UoM") * price_unit_uos (dp as "Product Price") = subtotal (dp as "Account")
dp = decimal precision

A case of use:
Description VAT Quantity Unit Disc.(%) Price Price
Handful of peanuts ITAX S 10.000 g 20.00 0.00 200.00 €
Handful of peanuts (big) ITAX S 30.000 g 8.33 0.00 250.00 € <-- This should be: 30.000*8.33=249.90

In this simple case we see how rounding methods can easily make a 0.10€ difference.

So to correctly fix this it may be necessary to create the product.template.list_price_uos, as pointed in those code comments I told about. Would it be acceptable in OCB? (It adds a column)
Or should I create a new module that fixes this and make a MP into community branches?
Not sure, because it's a bug for me (as an incomplete feature), but it modifies the module.
"

review: Needs Information

Unmerged revisions

6827. By Alejandro Santana

[FIX] Fixes the sales order report to show correctly the unit price if UoS is definied. Also corrects the decimal precision of subtotals, total untaxed, taxes and total taxed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/report/sale_order.rml'
2--- sale/report/sale_order.rml 2013-11-20 01:17:39 +0000
3+++ sale/report/sale_order.rml 2014-01-19 23:04:55 +0000
4@@ -67,7 +67,6 @@
5 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
6 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
7 <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
8- <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
9 </blockTableStyle>
10 <blockTableStyle id="Table6">
11 <blockAlignment value="LEFT"/>
12@@ -126,11 +125,8 @@
13 <images/>
14 </stylesheet>
15 <story>
16- <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
17- <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
18- <para style="terp_default_9">
19- <font color="white"> </font>
20- </para>
21+ <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
22+ <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
23 <blockTable colWidths="265.0,51.0,225.0" style="Table1">
24 <tr>
25 <td>
26@@ -208,32 +204,7 @@
27 <para style="terp_default_8">
28 <font color="white"> </font>
29 </para>
30- <pto>
31- <pto_header>
32- <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4">
33- <tr>
34- <td>
35- <para style="terp_tblheader_Details">Description</para>
36- </td>
37- <td>
38- <para style="terp_tblheader_Details_Centre">VAT</para>
39- </td>
40- <td>
41- <para style="terp_tblheader_Details_Right">Quantity</para>
42- </td>
43- <td>
44- <para style="terp_tblheader_Details_Right">Unit Price</para>
45- </td>
46- <td>
47- <para style="terp_tblheader_Details_Centre">Disc.(%)</para>
48- </td>
49- <td>
50- <para style="terp_tblheader_Details_Right">Price</para>
51- </td>
52- </tr>
53- </blockTable>
54- </pto_header>
55- <blockTable colWidths="181.0,70.0,80.0,70.0,50.0,85.0" repeatRows="1" style="Table4">
56+ <blockTable colWidths="202.0,94.0,68.0,59.0,50.0,63.0" repeatRows="1" style="Table4">
57 <tr>
58 <td>
59 <para style="terp_tblheader_Details">Description</para>
60@@ -257,7 +228,7 @@
61 </blockTable>
62 <section>
63 <para style="terp_default_1">[[repeatIn(o.order_line,'line')]]</para>
64- <blockTable colWidths="180.0,70.0,80.0,70.0,50.0,85.0" style="Table5">
65+ <blockTable colWidths="203.0,94.0,68.0,61.0,42.0,70.0" style="Table5">
66 <tr>
67 <td>
68 <para style="terp_default_9">[[ line.name ]] </para>
69@@ -269,13 +240,13 @@
70 <para style="terp_default_Right_9">[[ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty) ]] [[ line.product_uos and line.product_uos.name or line.product_uom.name ]]</para>
71 </td>
72 <td>
73- <para style="terp_default_Right_9">[[ formatLang(line.price_unit ) ]]</para>
74+ <para style="terp_default_Right_9">[[ formatLang(line.product_uos and (line.price_unit * line.product_uom_qty / line.product_uos_qty) or line.price_unit , digits=get_digits(dp='Product Price'))]]</para>
75 </td>
76 <td>
77 <para style="terp_default_Centre_9">[[ formatLang(line.discount) ]]</para>
78 </td>
79 <td>
80- <para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Sale Price'), currency_obj=o.pricelist_id.currency_id) ]]</para>
81+ <para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id) ]]</para>
82 </td>
83 </tr>
84 <tr>
85@@ -310,8 +281,7 @@
86 </tr>
87 </blockTable>
88 </section>
89- </pto>
90- <blockTable colWidths="381.0,60.0,93.0" style="Table6">
91+ <blockTable colWidths="374.0,69.0,94.0" style="Table6">
92 <tr>
93 <td>
94 <para style="terp_default_9">
95@@ -322,7 +292,7 @@
96 <para style="terp_default_9">Net Total :</para>
97 </td>
98 <td>
99- <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]</para>
100+ <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]</para>
101 </td>
102 </tr>
103 <tr>
104@@ -335,7 +305,7 @@
105 <para style="terp_default_9">Taxes :</para>
106 </td>
107 <td>
108- <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]</para>
109+ <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]</para>
110 </td>
111 </tr>
112 <tr>
113@@ -348,13 +318,11 @@
114 <para style="terp_default_Bold_9">Total :</para>
115 </td>
116 <td>
117- <para style="terp_default_Right_9_Bold">[[ formatLang(o.amount_total, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]</para>
118+ <para style="terp_default_Right_9_Bold">[[ formatLang(o.amount_total, dp='Account', currency_obj=o.pricelist_id.currency_id) ]]</para>
119 </td>
120 </tr>
121 </blockTable>
122- <para style="terp_default_8">
123- <font color="white"> </font>
124- </para>
125+ <para style="terp_default_8"/>
126 <para style="terp_default_9">[[ format(o.note or '') ]]</para>
127 <blockTable colWidths="533.0" style="Table7">
128 <tr>
129
130=== modified file 'sale/report/sale_order.sxw'
131Binary files sale/report/sale_order.sxw 2012-12-17 09:49:00 +0000 and sale/report/sale_order.sxw 2014-01-19 23:04:55 +0000 differ

Subscribers

People subscribed via source and target branches