[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.
This commit is contained in:
parent
ccd2f68af0
commit
f46fa1d026
|
@ -52,10 +52,7 @@ class sale_order_line(osv.osv):
|
||||||
for line in self.browse(cr, uid, ids, context=context):
|
for line in self.browse(cr, uid, ids, context=context):
|
||||||
res[line.id] = 0
|
res[line.id] = 0
|
||||||
if line.product_id:
|
if line.product_id:
|
||||||
if line.purchase_price:
|
res[line.id] = round(line.price_subtotal - ((line.purchase_price or 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.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)
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
|
|
Loading…
Reference in New Issue