コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
1146 ビュー

 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

アバター
破棄
関連投稿 返信 ビュー 活動
Odoo App 解決済
1
11月 23
1664
0
5月 24
1415
0
9月 23
2346
0
9月 23
1988
0
8月 23
1850