Skip to Content
Menu
This question has been flagged
1 Atsakyti
5355 Rodiniai

So, I'm trying get the value of a field as a string, and all I get when I cast the self.pool.get method to a string is a big fat "None"

Here's my code:

ccNum = str( self.pool.get('account.voucher').browse(cr,uid,'card_number',context=None)[0] )

Can I not cast this to a string? If not, then what do I need to do to get the value out as a string instead of an object?

Portretas
Atmesti
Autorius Best Answer

Fixed it!

Was using the wrong function. Here's the right way:

ccNum = str( self.pool.get('account.voucher').read(cr,uid,ids,['card_number'],context=None)[0]['card_number'] )

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
kov. 15
9732
6
birž. 17
42140
3
gruod. 15
1367
1
rugp. 22
2813
1
lapkr. 15
7326