Skip to Content
Menu
This question has been flagged
2 Replies
2435 Views

Hi,

we use odoo 11,

How display field date the first record tree view in qweb report.

please help me, Thanks.

python:

deliver_product   = fields.One2many(' deliver.product ', 'dev_id', string='Delivery product')  

class  deliver_product _tree(models.Model):  

_name = ' deliver.product '​ 

date_delivery = fields.Date('Date Delivery', track_visibility='onchange')     


qweb report xml:

<span t-esc="doc.deliver_product.date_delivery"/>


Avatar
Discard
Best Answer

which report that you want to insert that field.. i have example in invoice report

<template id="custom_decimal_precision_quantity" name="change_float_display_quantity_unit_price" inherit_id="account.report_invoice_document">

        <xpath expr="//span[@t-field='l.quantity']" position="replace">

            <span t-esc="'{:g}'.format(l.quantity)"/>

        </xpath>

</template>


first, you need to know the id of your report then override it using xpath tag

Avatar
Discard
Best Answer

Hello,

In a tree view you can place a field in a certain position with :
<xpath expr="//field[@name='the first field in you view']" position="before">
<field name="date_delivery"/>
</xpath>
If this is not what you want please paste the entire view here so I can have a better understanding of what you're trying to do.




Avatar
Discard