Odoo 报告 - 当值为空时显示 0
Odoo reporting - display 0 when values is null
我正在 OpenOffice 报表设计器中为 Odoo 设计报表。
我需要在下面的列中显示单位费率和折扣
"₹. 95.0 each
5% Discount"
我可以在报告中显示这些字段。
问题是当折扣为 0 时,它在报告中显示为空白
"₹. 95.0 each
% Discount"
如果空白,我想显示 0。如何实现?
当字段值为null
时显示为空string.so使用条件显示'0'
:
[[ o.discount or '0' ]]
要显示例如 5%
或 0
,请使用:
[[ o.discount and formatLang(o.discount) + '%' or '0']]
我正在 OpenOffice 报表设计器中为 Odoo 设计报表。 我需要在下面的列中显示单位费率和折扣
"₹. 95.0 each
5% Discount"
我可以在报告中显示这些字段。 问题是当折扣为 0 时,它在报告中显示为空白
"₹. 95.0 each
% Discount"
如果空白,我想显示 0。如何实现?
当字段值为null
时显示为空string.so使用条件显示'0'
:
[[ o.discount or '0' ]]
要显示例如 5%
或 0
,请使用:
[[ o.discount and formatLang(o.discount) + '%' or '0']]