Merge lp:~openerp-dev/openobject-addons/trunk-bug-1176031-cod into lp:openobject-addons

Proposed by Chirag Dodiya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1176031-cod
Merge into: lp:openobject-addons
Diff against target: 16 lines (+3/-2)
1 file modified
sale_margin/sale_margin.py (+3/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1176031-cod
Reviewer Review Type Date Requested Status
Turkesh Patel (openERP) Pending
Review via email: mp+199112@code.launchpad.net

Description of the change

Hello,

    I have fixed this bug "Wrong calculation of sale margin",in sale margin it was calculate margin base on product_uos_ qty which was wrong, i removed product_uos_ qty for calculate sale price and set product_uom_ qty for calculate purchase price.

Thanks,
Chirag Dodiya(cod).

To post a comment you must log in.

Unmerged revisions

9018. By Chirag Dodiya(OpenERP)

[FIX] fixed wrong calculation of sale margin

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale_margin/sale_margin.py'
2--- sale_margin/sale_margin.py 2013-10-27 12:31:04 +0000
3+++ sale_margin/sale_margin.py 2013-12-16 13:06:56 +0000
4@@ -45,9 +45,10 @@
5 res[line.id] = 0
6 if line.product_id:
7 if line.purchase_price:
8- 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)
9+ res[line.id] = round((line.price_unit*(100.0-line.discount)/100.0) -(line.purchase_price*line.product_uom_qty), 2)
10+
11 else:
12- 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)
13+ res[line.id] = round((line.price_unit*(100.0-line.discount)/100.0) -(line.product_id.standard_price*line.product_uom_qty), 2)
14 return res
15
16 _columns = {

Subscribers

People subscribed via source and target branches

to all changes: