콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
5305 화면

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

아바타
취소
관련 게시물 답글 화면 활동
3
7월 25
27221
2
6월 25
2258
4
5월 24
6225
1
5월 23
3998
1
4월 19
14913