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.!!!}}
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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.!!!}}
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)
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Jan 23
|
23785 | ||
|
4
Jun 21
|
37400 | ||
|
1
Dec 20
|
1489 | ||
|
1
Apr 18
|
6459 | ||
Why Odoo is so successful
Solved
|
|
3
Sep 15
|
8481 |