I am designing reports for Odoo in OpenOffice reports designer. I need to show rate per unit and discount in column as below
我正在为OpenOffice报表设计器中的Odoo设计报表。我需要在列中显示单位费率和折扣,如下所示
"₹. 95.0 each
5% Discount"
I am able to display these fields on report. Issue is when discount is 0, it displays blank in report as below
我可以在报告上显示这些字段。问题是当折扣为0时,它在报告中显示如下空白
"₹. 95.0 each
% Discount"
I want to show 0 instead if blank. How can this be achieved?
如果空白,我想显示0。怎么能实现这一目标?
1 个解决方案
#1
1
When field value is null
it will display an empty string.so use condition to display '0'
:
当字段值为null时,它将显示一个空字符串。所以使用条件显示“0”:
[[ o.discount or '0' ]]
To display for example 5%
or 0
, use:
要显示例如5%或0,请使用:
[[ o.discount and formatLang(o.discount) + '%' or '0']]
#1
1
When field value is null
it will display an empty string.so use condition to display '0'
:
当字段值为null时,它将显示一个空字符串。所以使用条件显示“0”:
[[ o.discount or '0' ]]
To display for example 5%
or 0
, use:
要显示例如5%或0,请使用:
[[ o.discount and formatLang(o.discount) + '%' or '0']]