Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
5368 Vizualizări

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?

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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'] )

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
mar. 15
9746
6
iun. 17
42147
3
dec. 15
1367
1
aug. 22
2819
1
nov. 15
7332