跳至内容
菜单
此问题已终结
1 回复
4003 查看

I did resolved this issue.

Code:

from openerp import models, fields, api

class Student(models.Model):

    _name = 'test.student'

    key = fields.Char('Key', required=True)

    value = fields.Char('Value', required=True)

    dynamic_select =fields.Selection(selection='_method_name' )



@api.v8

def _method_name(self):

    res = self.search([])

    dict = {}

    for i in res:

        key=i.key

        dict[key]=i.value

    return [(j,i) for i,j in dict.items()]



Devloper: Kirubanidhi

形象
丢弃
最佳答案

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

形象
丢弃