gpt4 book ai didi

python - 如何将发票来源字段添加到 qweb 报告?

转载 作者:数据小太阳 更新时间:2023-10-29 03:00:02 28 4
gpt4 key购买 nike

我想将“account.invoice”模型中的源文档“来源”字段添加到 qweb 报告中,但我不知道语法我只需要语法来添加这个字段我写的所有其他代码提前致谢。

class make_fields (models.Model):
_inherit = 'res.partner'

gt_origin = fields.Many2one('account.invoice')

<t t-foreach="o.gt_origin" t-as="line">
`enter code here`<span t-field="line.gt_origin.origin"/>
</t>

最佳答案

您不需要创建 foreach 循环。这应该足够了:

<t t-if="o.gt_origin">
<span t-field="o.gt_origin.origin" />
</t>

关于python - 如何将发票来源字段添加到 qweb 报告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53766643/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com