Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
3807 Ansichten

I code as below in .py

class Aa(models.Model): 

_name = 'a.word'

chars = fields.Char()# 
raw_field = fields.Selection(selection='_get_selection', string='What do you want ?')

@api.onchange('chars') 
def _get_selection(self):
     ix  = []                                         
    cols = self.chars.split(',') 
    for i , v in enumerate(cols):
        ix.append((str(i+1), v))
    return ix 


but these don't work as my intention and I also search about it on web and know that I should use Many2one field to get the similar effect; but I don;t know details, could you give me some advice?

Avatar
Verwerfen
Beste Antwort

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Juni 18
4724
1
Okt. 23
1926
2
Okt. 23
2143
2
Aug. 23
4124
4
Aug. 23
20446