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

 def button_get_payments_attachments(self):        

​self.ensure_one()        

​ids=[]        

​for invoice in self.invoice_ids:          

​​print('----------------',invoice.payment_ids)            

​print('----------------',invoice.payment_id)            


no results

---------------- account.payment()

---------------- account.payment()



            

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

You can use the following code to link a purchase order with its payments.


Python

from odoo import models


class PurchaseOrder(models.Model):
_inherit = 'purchase.order'

def button_get_payments_attachments(self):
self.ensure_one()
account_payment_ids = [
item['account_payment_id']
for payment in self.invoice_ids.mapped('invoice_payments_widget')
for item in payment.get('content', [])
]
return {
'type': 'ir.actions.act_window',
'name': 'Payments',
'res_model': 'account.payment',
'view_mode': 'tree,form',
'domain': [('id', 'in', account_payment_ids)],

}

Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Odoo App แก้ไขแล้ว
1
พ.ย. 23
1452
0
พ.ค. 24
1136
0
ก.ย. 23
2060
0
ก.ย. 23
1783
0
ส.ค. 23
1666