Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3980 มุมมอง

How can I create payment (full, partial) for customer invoice from my custom module? #odoo15

อวตาร
ละทิ้ง
ผู้เขียน

I created a payment but how can I link it to the invoice programmatically

คำตอบที่ดีที่สุด

Hello Saleh Algarni,

There is a button on "Register payment" on invoice. Using that button you can create the payment and it will automatically linked to invoice.

Hope it will help you. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thank you Jainesh Shan,

I know how to do it using UI, I am asking how can I do it programmatically, because I have custom module linked with invoices

 when I create payment using using custom module but I can't link that payment to an invoice

อวตาร
ละทิ้ง

If you are just trying to add a payment button to your view, while using the same backend logic, you can just imitate what is there already:
I assume you are aware of the odoo actions and views
These are the places where you can look:
-The current invoice payment button(line 632): https://github.com/odoo/odoo/blob/15.0/addons/account/views/account_move_views.xml
-The button return an action that display the form(line 3304): https://github.com/odoo/odoo/blob/15.0/addons/account/models/account_move.py

-If you want to go deep and do backend modifications you can skim through the account.payment.register model and its views https://github.com/odoo/odoo/blob/15.0/addons/account/wizard/account_payment_register.py https://github.com/odoo/odoo/blob/15.0/addons/account/wizard/account_payment_register_views.xml

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 24
1486
4
มิ.ย. 23
6638
3
มิ.ย. 24
2267
0
เม.ย. 24
2329
0
ก.พ. 24
1462