Skip to Content
मेन्यू
This question has been flagged
1 Reply
5461 Views

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
Discard

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

Best Answer

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
Discard
Related Posts Replies Views Activity
0
मार्च 25
1375
4
अप्रैल 24
174279
0
दिस॰ 23
2172
1
सित॰ 23
2106
5
जुल॰ 25
228050