تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
5107 أدوات العرض

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
يوليو 25
26645
2
يونيو 25
1994
4
مايو 24
6071
1
مايو 23
3860
1
أبريل 19
14804