跳至內容
選單
此問題已被標幟
4 回覆
4828 瀏覽次數

I search what field to overwrite from text to html. This snippet comes from "report_invoice_document" :

<div class="col-xs-2" t-if="o.name">
    <strong>Description:</strong>
    <p t-raw="o.name"/>

I already change t-value to t-raw but I don't find what field of what model to change for html...

頭像
捨棄
最佳答案

Hi

In this example, o is an instance of account.invoice, and containt each value of the invoice you want to print

Regards,


頭像
捨棄
最佳答案

 You can name it as you want it's just the object of the "foreach" qweb loop. It's normally at the top of the template.

<template id="report_my_report">
    <t t-call="report.html_container">
         <t t-foreach="docs" t-as="o">

The docs is what you pass to the template. 

頭像
捨棄
最佳答案

In QWEB, o is an instance of active model(it can sale.order,purchase.order,account.invoice...etc), and it contains each value of the model you want to print

頭像
捨棄
最佳答案

For example you have an object (res.partner(1)) . Than by using your code you can get records from that object using alias "o".

o.name

o.gender

etc

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
6月 25
1392
4
5月 24
5662
2
2月 24
25952
1
5月 23
3539
1
4月 19
14588