Hello,
I need to add an attachment (product draw), saved on product master data, to the bottom of pdf report of sales order.
Is it possible and how ?
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
Thanks so much , I will try it with the help of a programmer
Hi,
we can inherit the template and add the condition like
<t t-if="o.order_line">
<div class="page">
<h2>Sales Order</h2>
<!-- Other content of the report -->
<!-- Loop through order lines -->
<t t-foreach="o.order_line" t-as="line">
<div>
<h3 t-field="line.product_id.
<!-- Other line information -->
<!-- Display product drawing attachment -->
<t t-if="line.product_id.
<h4>Product Drawing:</h4>
<t t-foreach="line.product_id.
<a t-att-href="'/web/content/' + str(attachment.id) + '?download=true'" t-att-target="'_blank'">
<t t-esc="attachment.name"/>
</a>
</t>
</t>
</div>
</t>
</div>
</t>
Hope it helps
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
Registrieren