如何在 Odoo 12 或 OpenERP 中实现此功能?

How can I implement this function in Odoo 12 or OpenERP?

我正在尝试为发票创建条件函数。 我会写,但不知道如何在Odoo中通过代码实现。

我的函数

if(country_id==base.au || country_id==base.ca || country_id==base.jp || country_id==base.li)
{
   <t t-if="o.emb_confirm_message == True">
       <strong><th t-field="o.emb_message"/></strong>
   </t>
}

当发票包含任何国家/地区时,报告中会显示一条消息。 如何在 Odoo 12 中实现此功能? 谢谢

我不喜欢 QWeb 模板中的太多代码,但这应该可行:

<t t-set="is_for_emb_message_country"
    t-value="o.partner_id.country_id.id in [o.env.ref('base.au').id, o.env.ref('base.ca').id, o.env.ref('base.jp').id, o.env.ref('base.li').id]" />
<t t-if="o.emb_confirm_message is True and is_for_emb_message_country">
       <strong><th t-field="o.emb_message"/></strong>
</t>