콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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
4814
1
10월 23
2033
2
10월 23
2266
2
8월 23
4283
4
8월 23
20607