Ravish(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-1089229-rmu into 
lp:openobject-addons.

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

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1089229-rmu/+merge/143237

Hello,

I have solved the issue of "Sales using Secondary UoM show incorrect unit price 
Edit".
As per asked total is rounded up, is 10 rather then 9.98 for bug example.
Thanks
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1089229-rmu/+merge/143237
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1089229-rmu.
=== modified file 'sale/report/sale_order.py'
--- sale/report/sale_order.py	2012-12-06 14:56:32 +0000
+++ sale/report/sale_order.py	2013-01-15 07:27:23 +0000
@@ -28,7 +28,10 @@
         super(order, self).__init__(cr, uid, name, context=context)
         self.localcontext.update({
             'time': time,
+            'get_price_objects': self._get_price_objects,
         })
+    def _get_price_objects(self, price,qty):
+        return round((float(price)*qty))
 
 report_sxw.report_sxw('report.sale.order', 'sale.order', 'addons/sale/report/sale_order.rml', parser=order, header="external")
 

=== modified file 'sale/report/sale_order.rml'
--- sale/report/sale_order.rml	2012-12-21 16:48:08 +0000
+++ sale/report/sale_order.rml	2013-01-15 07:27:23 +0000
@@ -272,13 +272,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">[[ formatLang(line.discount, digits=get_digits(dp='Discount'))]]</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 and get_price_objects(formatLang((line.price_unit * line.product_uom_qty / line.product_uos_qty)),line.product_uos_qty) or 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	2012-12-09 17:56:41 +0000 and sale/report/sale_order.sxw	2013-01-15 07:27:23 +0000 differ
_______________________________________________
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