Skip to content
Snippets Groups Projects
Commit f46fa1d0 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] sale_margin: margin handle included taxes for sale

Another fix should probably be build for purchase price, but it isn't that easy, we need to know the partner to which the product has been purchased, as taxes are partner/country dependent.

Besides, included taxes in purchase prices happen less often.
parent ccd2f68a
No related branches found
No related tags found
No related merge requests found
......@@ -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 = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment