Skip to Content
Menu
This question has been flagged

I have a field with a default value that uses the translation function (underscore):

 so_code=fields.Char(string='Κωδικός',copy=False,readonly=True,default=lambda self:_('New')) 


It's working and the field gets stored translated depending on the user's language. 


But how can I use the field's value in an if statement?


For example, this doesn't work and fails to detect translated values of the field:


   if (self["so_code"]==_('New')):


Avatar
Discard
Related Posts Replies Views Activity
3
Apr 24
994
0
May 24
46
1
Apr 24
1822
4
Sep 23
3074
2
Sep 23
5592