1
如何从循环填充选择字段?从循环odoo中填充选择字段9
实施例:
date = fields.Selection([],string='Date')
list = []
for i in diff:
print(i) #return 07:00
self.date = list
如何从循环填充选择字段?从循环odoo中填充选择字段9
实施例:
date = fields.Selection([],string='Date')
list = []
for i in diff:
print(i) #return 07:00
self.date = list
你可以选择场键,通过以下的方法值对。
result=self.env[model].fields_get([field_name])
key=False
if result and result.get(field_name) and result.get(field_name).get('selection'):
for dict_value in result.get(field_name).get('selection'):
print dict_value
这可能对你有所帮助。