i need to take the values Current Year, Previous year etc. dynamically from a table(model)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
i need to take the values Current Year, Previous year etc. dynamically from a table(model)
try many2one field for selection widget.
in dashboard?
yes.
Two Ways for this:
1. First you can call a function in selection field to get the options for the field. Here is an example:
@api.model
def get_field_options(self):
#compute the list as per your requirement and for the list in format below
value_list = [('one','option 1'),('two','option 2')]
return value_list
dynamic_field = fields.Selection(selection='get_field_options', string="Field Dummy")
2. If you just need values from a table as a selection, then try many2one field with selection widget.
Hope this helps :)
thanks for the answer shyam. But the actual problem is not this. I want this field to be shown in dashboard as editable selection field.
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-seRelated Posts | Respostes | Vistes | Activitat | |
---|---|---|---|---|
|
1
d’ag. 24
|
1414 | ||
|
2
de juny 24
|
1832 | ||
|
1
de març 23
|
3486 | ||
|
1
d’oct. 20
|
3603 | ||
|
1
de febr. 20
|
6794 |