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
- Účtovníctvo
- Sklady
- PoS
- Project
- MRP
This question has been flagged
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrácia