Skip to Content
Menu
This question has been flagged
1 Reply
4504 Views

How I affect the name of a field section item ('A') to a char field and not the value ('a')

field1: fields.selection([('a','A')], 'Field1'),
field2: fields.char('Field2'),

return { value{'field2' : field1.!!!}}

Avatar
Discard
Best Answer

If you want the value of the selection field you should use :

(Example for ir model)

self.env['ir.model'].fields_get(allfields=['state'])['state']['selection']

For you , you should use 

self.env['your.model'].fields_get(allfields=['field1'])['field1']['selection']

return a dictionary with all your data (key:value)

Avatar
Discard
Related Posts Replies Views Activity
2
Jan 23
23785
4
Jun 21
37400
1
Dec 20
1489
1
Apr 18
6459
3
Sep 15
8481