Somesh Khare(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-10321-skh into 
lp:openobject-addons/6.0.

Requested reviews:
  Priyesh (OpenERP) (pso-openerp)
  Jay Vora (OpenERP) (jvo-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-10321-skh/+merge/67142

Hello Sir,

There are two issue,

1. Install sale_margin module. It will calculate wrong margin. I have modifies 
the code to compute the correct margin.
2. In the Sale module when user click on the compute button. It will not 
calculate the margin for the first time. Open the sale_order_line and 
Save&Close. Now click on the compute will give you the computed margin. 

Thanks 
SKH
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-10321-skh/+merge/67142
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-10321-skh.
=== modified file 'sale/sale.py'
--- sale/sale.py	2011-05-17 11:44:45 +0000
+++ sale/sale.py	2011-07-07 09:28:35 +0000
@@ -366,7 +366,7 @@
         return super(sale_order, self).create(cr, uid, vals, context=context)
 
     def button_dummy(self, cr, uid, ids, context=None):
-        return True
+        return self.write(cr, uid, ids, {}, context=context)
 
     #FIXME: the method should return the list of invoices created (invoice_ids)
     # and not the id of the last invoice created (res). The problem is that we

=== modified file 'sale_margin/sale_margin.py'
--- sale_margin/sale_margin.py	2011-04-14 11:10:33 +0000
+++ sale_margin/sale_margin.py	2011-07-07 09:28:35 +0000
@@ -43,9 +43,9 @@
             res[line.id] = 0
             if line.product_id:
                 if line.purchase_price:
-                    res[line.id] = round((line.price_unit*line.product_uos_qty*(100.0-line.discount)/100.0) -(line.purchase_price*line.product_uos_qty), 2)
+                    res[line.id] = round((line.price_unit*line.product_uos_qty*(100.0-line.discount)/100.0) -(line.purchase_price*line.product_uom_qty), 2)
                 else:
-                    res[line.id] = round((line.price_unit*line.product_uos_qty*(100.0-line.discount)/100.0) -(line.product_id.standard_price*line.product_uos_qty), 2)
+                    res[line.id] = round((line.price_unit*line.product_uos_qty*(100.0-line.discount)/100.0) -(line.product_id.standard_price*line.product_uom_qty), 2)
         return res
 
     _columns = {

_______________________________________________
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