Hi everyone,
I am trying to customize the PDF RFQ and PO with editing the standard code withing Odoo CE 10. Default Odoo prints 3 fields: Description, Date, and Quantity. Now I would also like the Product name to be added because often we change the description field with custom text for our supplier to understand better so we still need the product name to be printed too. So far I've been able to change it almost to my liking but there are some issues still.
Here's my customized code:
<h2>Request for Quotation <span t-field="o.name"/></h2>
<table class="table table-condensed">
<thead>
<tr>
<th class="text-left"><strong>Product Name</strong></th>
<th class="text-left"><strong>Description</strong></th>
<th class="text-left"><strong>Expected Date</strong></th>
<th class="text-left"><strong>Qty</strong></th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.order_line" t-as="order_line">
<td>
<span t-field="o.product_id.name"/>
</td>
<td class="text-left">
<span t-field="order_line.name"/>
</td>
<td class="text-left">
<span t-field="order_line.date_planned"/>
</td>
<td class="text-left">
<span t-field="order_line.product_qty"/>
<span t-field="order_line.product_uom"/>
</td>
</tr>
</tbody>
</table>
So as you can see I added "Product Name" to the header and I've also added "<span t-field="o.product_id.name"/>" to the code. I know there is something wrong with this approach because the result does not give me what I'm looking for.
In \this link you can see the result of the generated PDF. So the layout is perfect but the product name is not refreshed per line. I'm sure it's something simple in the code but I could not figure it out...
Additional questions:
- How can I make the "Product Name" text also automatically translatable by Odoo? as you can see now it's in English while the rest is in Indonesian...
- How can I make the date field only show the date without the time?
- How can I show the unit only once?
Thanks for your help!