[FIX] mrp_repair: tax calculation and subtotal
Following commit 5b380e13, the the taxes on the fees are not calculated
correctly. Moreover, setting the subtotal in the onchange is misleading
since it will be set to zero if the line is not invoiced. We just set
the price to zero by default, and the click on 'update' will set it
correctly afterwards.
opw-673984
This commit is contained in:
@@ -525,7 +525,7 @@ class ProductChangeMixin(object):
|
||||
"You have to change either the product, the quantity or the pricelist.")
|
||||
}
|
||||
else:
|
||||
result.update({'price_unit': price, 'price_subtotal': price * product_uom_qty})
|
||||
result.update({'price_unit': price, 'price_subtotal': 0.0})
|
||||
|
||||
return {'value': result, 'warning': warning}
|
||||
|
||||
@@ -643,7 +643,7 @@ class mrp_repair_fee(osv.osv, ProductChangeMixin):
|
||||
if line.to_invoice:
|
||||
cur = line.repair_id.pricelist_id.currency_id
|
||||
taxes = tax_obj.compute_all(cr, uid, line.tax_id.ids, line.price_unit, cur.id, line.product_uom_qty, line.product_id.id, line.repair_id.partner_id.id)
|
||||
res[line.id] = taxes['total_included']
|
||||
res[line.id] = taxes['total_excluded']
|
||||
else:
|
||||
res[line.id] = 0
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user