Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Wrong Amount Due after creating custom module

By
Ghassen Rjab
on 1/15/16, 9:49 AM 351 views

Hi,

I recently developed a module to change the behavior of _compute_amount method of account.invoice class and the view of account.invoice.form. Everything works fine (the model and the view). But I have a problem now, because when I confirm the invoice the amount due is not the same as the total.

Here's what I changed in the _compute_amount method:

self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line_ids)
self.amount_fodec = self.amount_untaxed * self.fodec_id.amount / 100
amount_untaxed_with_fodec = self.amount_untaxed + self.amount_fodec
self.amount_tva = amount_untaxed_with_fodec * self.tva_id.amount / 100
self.amount_tax = self.amount_fodec + self.amount_tva + self.timbre_fiscal
self.amount_total = self.amount_untaxed + self.amount_tax

 As you can see I added more taxes. _compute_amount is fine but what can I do to correct the amount due, because it just uses the default taxing mechanism (not the one I developed in my new method)?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/15/16, 9:49 AM
Seen: 351 times
Last updated: 1/15/16, 9:50 AM