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

How to call action "update" on Invoice form view on quantity change?

By
Dr Obx
on 3/9/16, 8:40 AM 910 views

In Odoo 8.0 - Accounting - While I'm creating an invoice (manually) once you add a products etc it calculate TOTAL price but to update tax must click "UPDATE" button. (WHY!?)

I would like to remove this button and change code to calculate everything again automatically after quantity is changed or something ?

I already tried call method button_reset_tax and calculate_taxes but I can't make it work. So if anyone would like to help me ... solve this issue ?

@api.onchange

def onchange_quantity(self):

    self.button_reset_taxes()# calling 'button_reset_taxes'

    print 'Recalculating VAT ....'

    return True

but it won't work .... getting error:

Traceback (most recent call last):

 ....................

return self._browse(Environment(cr, uid, context or {}), ids)

File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 713, in __new__

self.cr, self.uid, self.context = self.args = (cr, uid, frozendict(context))

TypeError: 'float' object is not iterable

Any ideas ?

any ideas why it won't work ?

Hello, an idea could be to call button_reset_taxes() method of account.invoice at the moment of creation/writing of invoice line

Diego Vázquez
on 3/9/16, 9:12 AM

I tried it, but it won't work ... ;(

Dr Obx
on 3/11/16, 8:41 AM

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: 3/9/16, 8:40 AM
Seen: 910 times
Last updated: 3/19/16, 6:32 PM