Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3765 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
cze 18
4681
1
paź 23
1878
2
paź 23
2111
2
sie 23
4098
4
sie 23
20394