Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3830 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มิ.ย. 18
4731
1
ต.ค. 23
1951
"Wrong value for %s: %r" % (self, value) แก้ไขแล้ว
2
ต.ค. 23
2153
2
ส.ค. 23
4160
4
ส.ค. 23
20480