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

Hi

I would like to know how can I use an option of a selection field in a view to show a custom field in a report

For example I have this selection field

mySelection = fields.Selection([
('01', 'Number 1'),
('02', 'Number 2'),
('03', 'Number 3'),
('04', 'Number 4')
],required=True)

And I would like to show in a report a custom field when for example the option 02 is selected

Im trying like this 

<t t-if="doc.mySelection == 'Number 2'">
<span t-field="custom_field"/></t>

But it doesn't show my field

Thank you for the help

形象
丢弃
最佳答案

Hi,

Compare using the key, try this.

<t t-if="doc.mySelection == '02'">
<span t-field="custom_field"/></t>


Thanks

形象
丢弃
编写者

Thanks, I did that and it worked

相关帖文 回复 查看 活动
2
9月 24
1865
5
8月 19
46482
4
6月 18
20032
0
6月 18
3254
2
12月 17
16839