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.

2

How to apply a tax based on a condition?

By
Julián Lozano
on 3/27/13, 2:50 PM 2,396 views

In this case I have a tax that can be applied if the total amount before taxes is bigger than a fixed value.

3

Davide Corio

--Davide Corio--
1822
| 4 3 7
Bricherasio, Italy
--Davide Corio--

Odoo Evangelist and Consultant

Davide Corio
On 3/27/13, 5:13 PM

On the tax form, you can select Python Code as Tax Type.

this way you can decide if apply the tax or not depending on your conditions.

BUT the amount before taxes isn't available as local variable during the computation. neither is the quantity, so you can't just do price_unit*qty (price_unit is available as local variable).

BUT you can extend the _unit_compute method of account_tax to include what you need.

Then, you can also decide if that tax must not appear at all. To do this you can use the applicability field you find under the Special Computation tab on the tax form.

This field works only if you selected Python Code earlier as Tax Type.

To extend this to include other variables you'll have to inherit the _applicable method of account_tax.

Thanks. I really appreciate this If you can tell how. I am not good at python nor in OpenERP structures. What do you mean with extend a method?.

Scalaria S.A.S., Julián Lozano
on 4/2/13, 10:22 PM

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

2 follower(s)

Stats

Asked: 3/27/13, 2:50 PM
Seen: 2396 times
Last updated: 3/16/15, 8:10 AM