Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
5099 Prikazi

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
Opusti
Best Answer

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
mar. 25
1114
2
jun. 20
6188
1
avg. 18
4404
2
maj 16
3415
4
mar. 16
14834