如果值为“TRUE”,我想在PDF中显示一个布尔字段,然后打印“Head Office”,但如果“False”则打印“Sub Branch”
<field name='is_branch'/>
in .sxw
[repeatIn(objects,'o')]]
[[(o.is_pk_branch=='TRUE') and 'Sub Branch' or 'Head Office']]
但在PDF中只显示'总公司' 有人请帮助我。
答案 0 :(得分:0)
试试这个,
[[ (o.is_pk_branch==True and "Head Office") or "Head Office"]]