跳至内容
菜单
此问题已终结
1 回复
5125 查看

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
形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
0
3月 25
1114
2
6月 20
6195
1
8月 18
4408
2
5月 16
3418
4
3月 16
14837