diff options
| author | Denis Ledoux <dle@odoo.com> | 2014-12-12 15:46:54 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2014-12-12 15:46:54 +0100 |
| commit | 8ef286a12cb4e2e0fa45f7e17d7f59e838ca1677 (patch) | |
| tree | cc09af6258761e4647092db0733095aa2dda2ed6 /addons | |
| parent | 0b6078dfea9cd60f7273e431fe52dd8ff4863607 (diff) | |
| parent | 162eb8443801fa7dbe8d3c4c48c17313d7c97f25 (diff) | |
[MERGE] forward port of branch saas-3 up to 162eb84
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/sale_margin/sale_margin.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index b5c1821ab98..ec1bd83dd50 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -52,10 +52,7 @@ class sale_order_line(osv.osv): 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) - 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_subtotal - ((line.purchase_price or line.product_id.standard_price) * line.product_uos_qty), 2) return res _columns = { |
