Odoo Help


Is there any way to calculate amount_subtotal from account.invoice.line use onchange of tax without clock on update Button

on 6/27/14, 3:04 AM 979 views


I want to calculate amount_subtotal use onchange function of tax_id without click on the update button of customer invoice line.....need a help

David Arnold
On 6/27/14, 4:19 AM

One of the reasons there is a button might be, that the tax calculation method is a rather costly python method. Actually you can kind of verify this when clicking on the update button. It is not truely "lighting fast".

Asuming you wouldn't be scared by performance decline you should probably look for the action that is triggered by the Update Button within the account_invoice.xml

Then you might add a onchange onto a meaningful field of the invoice line. Product Id is probably not wise, as it doen't change with quantity, euqally quantitiy might not change with price, and price might not change with discount, and discount might not change with taxes.. So probably the hard bit is to intelligently figure out on wich field change, you want the calculus to be triggered (altering other fields having not update effect, and running it on every field being performancewise totaly unacceptable)


-- EDIT --

Sorry I only got it right after a second and third reading.

You should probably look at the computation:


How the update method works:

I would truely suggest, observing as well the corresponding activity on the dev branch, as tax is refactored in V8.
There is a whole set of branches like: https://github.com/odoo-dev/odoo/tree/master-new-tax-design-tpa

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/27/14, 3:04 AM
Seen: 979 times
Last updated: 3/16/15, 8:10 AM