Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
4781 Weergaven

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?

Avatar
Annuleer
Beste antwoord

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.

Avatar
Annuleer

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.

Beste antwoord

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mrt. 15
4981
1
jul. 25
541
2
jul. 25
686
1
jul. 25
1744
3
apr. 25
1765