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

Update invoice "amount_tax" via API

By
Cole
on 5/6/15, 4:40 AM 502 views

Hello, I need to update the field "amount_tax" in the invoices (account.invoice).

I tried to set the field at the creation of the invoice (using API), but the "amount_tax" still remains 0.00 so I decided to insert the invoice lines after the creation of the invoice but the "amount_tax" is not recalculated automatically.

Then, I tried to update the invoices via API after the insertion of the lines with this code (amount_tax value is for example):

sock.execute(dbname, uid, pwd, 'account.invoice', 'write', invoice_id, {'amount_tax': '50'})

But i get this error:

No value found for account.invoice('372',).currency_id: ''> 

('372' is the invoice id)

Is there a better way to do this?

Is the update code wrong?


Any help is appreciated

check in script for invoice_id or print invoice_id before use.

Solanki Shamji
on 5/6/15, 5:09 AM

Thank you, the error was in the invoice_id variable...sorry for this question

Cole
on 5/6/15, 8:55 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: 5/6/15, 4:40 AM
Seen: 502 times
Last updated: 5/6/15, 8:55 AM