← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~alejandrosantana/ocb-addons/7.0-ocb-addons-fix-bug-1089229 into lp:ocb-addons

 

Alejandro Santana has proposed merging lp:~alejandrosantana/ocb-addons/7.0-ocb-addons-fix-bug-1089229 into lp:ocb-addons.

Commit message:
[FIX] Fixes the sales order report to show correctly the unit price if UoS is definied.

Requested reviews:
  OpenERP Community Backports Team (ocb)
Related bugs:
  Bug #1089229 in OpenERP Community Backports (Addons): "Sales using Secondary UoM show incorrect unit price"
  https://bugs.launchpad.net/ocb-addons/+bug/1089229

For more details, see:
https://code.launchpad.net/~alejandrosantana/ocb-addons/7.0-ocb-addons-fix-bug-1089229/+merge/202233

[FIX] Fixes the sales order report to show correctly the unit price if UoS is definied.
Before, it showed the price of UoM, even if a UoS was defined, thus resulting in an invoice with wrong lines, which may be considered illegal.
-- 
https://code.launchpad.net/~alejandrosantana/ocb-addons/7.0-ocb-addons-fix-bug-1089229/+merge/202233
Your team OpenERP Community Backports Team is requested to review the proposed merge of lp:~alejandrosantana/ocb-addons/7.0-ocb-addons-fix-bug-1089229 into lp:ocb-addons.
=== modified file 'sale/report/sale_order.rml'
--- sale/report/sale_order.rml	2013-08-15 07:54:23 +0000
+++ sale/report/sale_order.rml	2014-01-20 00:52:38 +0000
@@ -275,13 +275,13 @@
             <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>
           </td>
           <td>
-            <para style="terp_default_Right_9">[[ formatLang(line.price_unit , digits=get_digits(dp='Product Price'))]]</para>
+            <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>
           </td>
           <td>
             <para style="terp_default_Centre_9">[[show_discount(user.id) and formatLang(line.discount, digits=get_digits(dp='Discount')) or '']]</para>
           </td>
           <td>
-            <para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id) ]] </para>
+            <para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id) ]]</para>
           </td>
         </tr>
       </blockTable>

=== modified file 'sale/report/sale_order.sxw'
Binary files sale/report/sale_order.sxw	2013-09-20 09:39:47 +0000 and sale/report/sale_order.sxw	2014-01-20 00:52:38 +0000 differ

Follow ups