Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
5610 Ansichten

aml = self.env['account.move.line'].search([])             

for record in aml:

if record.payment_id == self.id

self.env['account.move.line'].create({'number_id':self.number_id}) 

 I have piece of code. I want get payment_id from account_move_line but when i print it. it will account.payment(21,)
I can't compare with any other id. Help me, please. Thanks

Avatar
Verwerfen

Read more about Odoo Customization Tips: https://goo.gl/8HgnCF

Beste Antwort

The right way to compare is as follows

if record.payment_id and record.payment_id.id == self.id:

Please checkout Odoo's documentation on ORM API to know how to work with recordsets
https://www.odoo.com/documentation/12.0/reference/orm.html#recordsets




 


Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
März 25
1575
4
Apr. 24
174464
0
Dez. 23
2321
1
Sept. 23
2284
5
Juli 25
228832