mowafak hamdy
mowafak hamdy

Reputation: 21

How to add the invoice origin field to a qweb report?

I want to add source document 'origin' field from "account.invoice" model to qweb report and I dont know the syntax I only need the syntax to add this field all other code I wrote it Thanks in advance.

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>

Upvotes: 2

Views: 226

Answers (1)

ChesuCR
ChesuCR

Reputation: 9670

You do not need to make a foreach loop. This should be enough:

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

Upvotes: 4

Related Questions