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

Programmatically pay an invoice

By
Souleyman Rapaya
on 12/16/14, 10:35 AM 675 views

I have an invoice of type out_invoice which is already validated.

I want to programmatically create an account move and account move lines so that the invoice will be partially paid.

How can I construct my account move and account move lines to do that?

2

Ben Bernard

--Ben Bernard--
1083
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 12/17/14, 4:40 AM

The code that makes 'the account move' is mentioned by @zbik.

Other than copy-pasting the code, you can just trigger account voucher workflow (from create until posted). What you need to do is to fill necessary data (just see the account voucher view for payment, for example) and trigger the workflow.

This is actually a far better solution. The workflow for this payment triggers more than just creating move lines and since it can indeed be triggered from code, this would be preferential compared to manually creating account moves and lines.

Ludo - Neobis
on 12/17/14, 9:42 AM
0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 12/16/14, 11:52 AM

See method action_move_line_create() in module account_voucher, file account_voucher.py

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: 12/16/14, 10:35 AM
Seen: 675 times
Last updated: 3/16/15, 8:10 AM