Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
5110 Tampilan

How can I get invoice type ("in_invoice" or "out_invoice")? I try this but I have an error. (AttributeError: 'browse_record_list' object has no attribute 'type')

invoice = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context)
if invoice.type =='in_invoice':
    return True
else:
    return False
Avatar
Buang
Jawaban Terbai

Hello, .browse() returns list so you need to loop trough your result or in this case you can use

if invoice[0].type  == "in_invoice" 

Hope this helps.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mar 25
1114
2
Jun 20
6192
1
Agu 18
4408
2
Mei 16
3417
4
Mar 16
14836