在odoo中处理selection字段,通常情况下,如果拿到的是key, 还要再翻译成value.
这里可以用fields_get()这个函数,来实现这个问题
${dict(item.fields_get(allfields=['type_id'])['type_id']['selection']).get(item.type_id)}
这里的item 是数据集
‘type_id’ selection的字段值
在odoo中处理selection字段,通常情况下,如果拿到的是key, 还要再翻译成value.
这里可以用fields_get()这个函数,来实现这个问题
${dict(item.fields_get(allfields=['type_id'])['type_id']['selection']).get(item.type_id)}
这里的item 是数据集
‘type_id’ selection的字段值