تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4803 أدوات العرض

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?

الصورة الرمزية
إهمال
أفضل إجابة

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.

أفضل إجابة

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مارس 15
5008
1
يوليو 25
612
2
يوليو 25
749
1
يوليو 25
1812
3
أبريل 25
1853