跳至內容
選單
此問題已被標幟
1 回覆
3793 瀏覽次數

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?

頭像
捨棄
最佳答案

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
6月 18
4713
1
10月 23
1914
2
10月 23
2134
2
8月 23
4117
4
8月 23
20427