[FIX] mrp_repair: tax computation
This solved two issues. First, the price subtotal should contain the
price with taxes excluded, as it is the case in other modules.
Otherwise, the tax will be computed twice. Then, when an invoice is
generated, the taxes should be calculated...
This is an oversight of commit fe2b5f35a4.
opw-673984
This commit is contained in:
@@ -391,7 +391,7 @@ class mrp_repair(osv.osv):
|
||||
'price_subtotal': fee.product_uom_qty * fee.price_unit
|
||||
})
|
||||
repair_fee_obj.write(cr, uid, [fee.id], {'invoiced': True, 'invoice_line_id': invoice_fee_id})
|
||||
#inv_obj.button_reset_taxes(cr, uid, inv_id, context=context)
|
||||
inv_obj.compute_taxes(cr, uid, [inv_id], context=context)
|
||||
res[repair.id] = inv_id
|
||||
return res
|
||||
|
||||
@@ -548,7 +548,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
||||
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] = cur_obj.round(cr, uid, cur, taxes['total'])
|
||||
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