openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #26746
[Bug 1176031] Re: Wrong calculation of sale margin
** Also affects: openobject-addons
Importance: Undecided
Status: New
** No longer affects: ocb-addons
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1176031
Title:
Wrong calculation of sale margin
Status in OpenERP Addons (modules):
New
Bug description:
On sale_margin there are an error on calculation
for fix it on sale_margin/sale_margin.py
need to change line 50 and 52 (#)
def _product_margin(self, cr, uid, ids, field_name, arg, context=None):
res = {}
for line in self.browse(cr, uid, ids, context=context):
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*(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_uos_qty), 2)
return res
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1176031/+subscriptions