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

Is it possible to populate a selection field dynamically based on another field?
For example:

I have an integer field that the user populate with the value 3.

I want that the selection field automatically will be populated with the choices 1,2,3.

Thank you.

Imagine profil
Abandonează
Cel mai bun răspuns

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Imagine profil
Abandonează
Cel mai bun răspuns

use like this

field_name = fields.Selection(selection=lambda self: self.dynamic_selection(), string="Scheme", tracking=True)
def dynamic_selection(self):
        objs = self.env['object.name'].sudo().search([])
        selection = [(rec.scheme, rec.scheme) for rec in objs]
        return selection



Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mai 21
2831
1
feb. 21
18610
3
aug. 24
6287
1
sept. 22
1916
2
dec. 17
16942