我想将"account.vinvoice"模型中的源文档"origin"字段添加到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>